mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-29 23:21:36 +00:00
27 lines
522 B
Go
27 lines
522 B
Go
|
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 = 0
|
||
|
VersionPatch = 0
|
||
|
)
|
||
|
|
||
|
func VersionString() string {
|
||
|
version := fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
|
||
|
if branch != "" {
|
||
|
version += fmt.Sprintf("-%s", branch)
|
||
|
}
|
||
|
if build != "" {
|
||
|
version += fmt.Sprintf("+%s", build)
|
||
|
}
|
||
|
return version
|
||
|
}
|