Documentation
¶
Overview ¶
Package version provides a built-in versioning based on the version of your go modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildInfo ¶
type BuildInfo struct {
GoVersion string `json:"goVersion"`
Version string `json:"version"`
Commit string `json:"commit"`
Date string `json:"date"`
IsModified bool `json:"isModified"`
Settings []debug.BuildSetting `json:"-"`
}
BuildInfo holds versioning information
func Resolve ¶
func Resolve() BuildInfo
Resolve build information.
There are 2 possible sources to resolve version information.
1. It may be populated by your build system at release build time e.g. go build -ldflags="-X 'github.com/fredbi/go-cli/cli/version.buildVersion=v1.0.0'"
For more information, see this excellent tutorial: https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications
2. It may be populated by the go runtime, collecting metadata from the build.
Click to show internal directories.
Click to hide internal directories.