mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
parent
096191ca24
commit
3b0774805c
4 changed files with 45 additions and 3 deletions
26
internal/version.go
Normal file
26
internal/version.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue