mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-08 18:16:59 +00:00
34221938cc
* Version 0.8.2 * Correct account data position mapping * Try that again * Don't duplicate wait-for-shutdowns
44 lines
768 B
Go
44 lines
768 B
Go
package internal
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// the final version string
|
|
var version string
|
|
|
|
// -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 = 8
|
|
VersionPatch = 2
|
|
VersionTag = "" // example: "rc1"
|
|
)
|
|
|
|
func VersionString() string {
|
|
return version
|
|
}
|
|
|
|
func init() {
|
|
version = fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
|
|
if VersionTag != "" {
|
|
version += "-" + VersionTag
|
|
}
|
|
parts := []string{}
|
|
if build != "" {
|
|
parts = append(parts, build)
|
|
}
|
|
if branch != "" {
|
|
parts = append(parts, branch)
|
|
}
|
|
if len(parts) > 0 {
|
|
version += "+" + strings.Join(parts, ".")
|
|
}
|
|
}
|