Files
guestbook/version.go
T
Jonas Kaninda b4a740590b Initial commit
2026-07-06 20:02:09 +02:00

18 lines
542 B
Go

package main
import goutils "github.com/jkaninda/go-utils"
// version is the build version. Set it at build time with:
//
// go build -ldflags "-X main.version=1.0.0"
//
// It is overridable at runtime with APP_VERSION — handy for the canary demo,
// where you run two otherwise-identical builds (e.g. 1.0.0 and 2.0.0) and watch
// which one serves each request.
var version = "dev"
// resolveVersion returns APP_VERSION when set, otherwise the build version.
func resolveVersion() string {
return goutils.Env("APP_VERSION", version)
}