Documentation
¶
Overview ¶
Package version provides build-time version variables. Set these via -ldflags at build time:
go build -ldflags "-X github.com/hatami57/microjet/core/version.Version=1.2.3 \
-X github.com/hatami57/microjet/core/version.CommitHash=$(git rev-parse --short HEAD) \
-X github.com/hatami57/microjet/core/version.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "dev" CommitHash = "unknown" BuildTime = "unknown" )
Functions ¶
Types ¶
type Info ¶
type Info struct {
Version string `json:"version"`
CommitHash string `json:"commit_hash"`
BuildTime string `json:"build_time"`
GoVersion string `json:"go_version"`
}
Info holds all version fields as a value type for structured access or logging.
func (Info) PrintToStdout ¶
func (i Info) PrintToStdout()
PrintToStdout writes version fields as key=value lines to stdout.
Click to show internal directories.
Click to hide internal directories.