gostations/internal/version/version.go

18 lines
446 B
Go
Raw Permalink Normal View History

package version
// These vars are set at build time via -ldflags (see Makefile and .gitea/workflows/release.yml), e.g.
// -ldflags "-X github.com/gmgauthier/gostations/internal/version.Version=2.0.0 -X .../Commit=... -X .../BuildDate=..."
var (
Version = "dev"
Commit = ""
BuildDate = ""
)
// String returns a human-friendly version string.
func String() string {
if Commit != "" {
return Version + "-" + Commit
}
return Version
}