Documentation
¶
Overview ¶
Package version provides access to some of your binary's versioning information.
The easy way to integrate this package, but could bring about surprising behavior (read the source for details, it's just a one-liner!):
import _ "github.com/qiniu/version/v2/easyHook"
And if you want more control and less magic:
import "github.com/qiniu/version/v2" func main() { // make use of one of the prepopulated values _ = version.GitCommit // or output in the package-standard format in your CLI handler version.Print() }
Index ¶
Constants ¶
View Source
const Compiler = runtime.Compiler
Compiler is a convenient alias for runtime.Compiler.
Variables ¶
View Source
var ( // GoVersion is the version of the Go toolchain used to build the binary // (e.g. "go1.19.2"). // It defaults to value of runtime.Version() if not explicitly overridden. GoVersion = unknownProperty // GitCommit is the commit hash of the Git repository's HEAD at // build-time. // It defaults to the value as collected by the runtime/debug package if // not explicitly overridden. GitCommit = unknownProperty // GitCommitDate is GitCommit's commit date in RFC3339 format. // It defaults to the value as collected by the runtime/debug package if // not explicitly overridden. GitCommitDate = unknownProperty // GitTreeState becomes "dirty" if the source tree had local modifications // at build-time. // It stays empty otherwise and will not be shown in Print if this is the // case. GitTreeState = unknownProperty // GitTag is meant to be injected with the tag name associated with // GitCommit, by means of `go -ldflags` at build-time. // It stays empty otherwise and will not be shown in Print if this is the // case. GitTag = unknownProperty // BuildDate is meant to be injected with a string denoting the build time // of the binary, by means of `go -ldflags` at build-time. // It stays empty otherwise and will not be shown in Print if this is the // case. BuildDate = unknownProperty // Platform is a string in the form of "GOOS/GOARCH", e.g. "linux/amd64". Platform = unknownProperty // BuildComments can be used to associate arbitrary extra information with // the binary, by means of injection via `go -ldflags` at build-time. BuildComments = unknownProperty // Name is meant to be injected with the binary's intended name, by means // of `go -ldflags` at build-time. // It stays empty otherwise and will not be shown in Print if this is the // case. Name = unknownProperty )
Version information
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.