2020-09-02 17:18:08 +02:00
|
|
|
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
|
2020-10-08 15:53:46 +02:00
|
|
|
VersionMinor = 1
|
2020-09-02 17:18:08 +02:00
|
|
|
VersionPatch = 0
|
2020-10-01 17:09:11 +02:00
|
|
|
VersionTag = "" // example: "rc1"
|
2020-09-02 17:18:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func VersionString() string {
|
2020-10-01 17:09:11 +02:00
|
|
|
version := fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionTag)
|
2020-09-02 17:18:08 +02:00
|
|
|
if branch != "" {
|
|
|
|
version += fmt.Sprintf("-%s", branch)
|
|
|
|
}
|
|
|
|
if build != "" {
|
|
|
|
version += fmt.Sprintf("+%s", build)
|
|
|
|
}
|
|
|
|
return version
|
|
|
|
}
|