Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version is the semantic version number Version = "1.2.3" // GitCommit is the git commit hash (injected at build time) GitCommit = "unknown" // GitBranch is the git branch (injected at build time) GitBranch = "unknown" // BuildDate is the build date (injected at build time) BuildDate = "unknown" // BuildUser is the user who built the binary (injected at build time) BuildUser = "unknown" )
Functions ¶
func GetBuildMethod ¶ added in v1.0.2
func GetBuildMethod() string
GetBuildMethod returns the method used to build this binary
func GetDetailedVersionString ¶
func GetDetailedVersionString() string
GetDetailedVersionString returns a detailed version string for --version output
func GetVersionString ¶
func GetVersionString() string
GetVersionString returns a formatted version string
func IsDevelopment ¶
func IsDevelopment() bool
IsDevelopment returns true if this is a development build
Types ¶
type Info ¶
type Info struct {
Version string `json:"version"`
GitCommit string `json:"git_commit"`
GitBranch string `json:"git_branch"`
BuildDate string `json:"build_date"`
BuildUser string `json:"build_user"`
GoVersion string `json:"go_version"`
Platform string `json:"platform"`
BuildMethod string `json:"build_method"` // "make", "go-install", or "unknown"
VCSTime string `json:"vcs_time"` // VCS commit time
VCSModified bool `json:"vcs_modified"` // Whether VCS had uncommitted changes
}
Info contains version information
Click to show internal directories.
Click to hide internal directories.