Documentation
¶
Overview ¶
Package version provides build version information embedding for gokit applications.
Version, git commit, branch, and build time are set at compile time via -ldflags:
go build -ldflags "-X github.com/kbukum/gokit/version.Version=1.0.0"
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // These variables are set at build time using -ldflags Version = "dev" // Version from git tag or manual override GitCommit = "" // Git commit hash GitBranch = "" // Git branch name BuildTime = "" // Build timestamp GoVersion = "" // Go version used for build )
Functions ¶
Types ¶
type Info ¶
type Info struct {
Version string `json:"version"`
GitCommit string `json:"git_commit"`
GitBranch string `json:"git_branch"`
BuildTime string `json:"build_time"`
GoVersion string `json:"go_version"`
BuildDate time.Time `json:"build_date"`
IsRelease bool `json:"is_release"`
IsDirty bool `json:"is_dirty"`
}
Info represents version information
func GetVersionInfo ¶
func GetVersionInfo() *Info
GetVersionInfo returns comprehensive version information
Click to show internal directories.
Click to hide internal directories.