- Add version package with build-time variables - Inject version via ldflags in Dockerfile using git describe - Show version in footer on every page - Log version and commit on server startup
11 lines
312 B
Go
11 lines
312 B
Go
// Package version holds build-time version information injected via ldflags.
|
|
package version
|
|
|
|
// Version and Commit are set at build time via:
|
|
//
|
|
// -ldflags "-X github.com/ryanhamamura/games/version.Version=... -X github.com/ryanhamamura/games/version.Commit=..."
|
|
var (
|
|
Version = "dev"
|
|
Commit = "unknown"
|
|
)
|