aboutsummaryrefslogtreecommitdiff
path: root/internal/version.go
blob: 24201b35d1912d71455183fb8b7ffe1863753621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package internal

import "fmt"

// -ldflags "-X github.com/matrix-org/dendrite/internal.branch=master"
var branch string

// -ldflags "-X github.com/matrix-org/dendrite/internal.build=alpha"
var build string

const (
	VersionMajor = 0
	VersionMinor = 1
	VersionPatch = 0
	VersionTag   = "rc1" // example: "rc1"
)

func VersionString() string {
	version := fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionTag)
	if branch != "" {
		version += fmt.Sprintf("-%s", branch)
	}
	if build != "" {
		version += fmt.Sprintf("+%s", build)
	}
	return version
}