MCPcopy Create free account
hub / github.com/containerd/nerdctl / GetVersion

Function GetVersion

pkg/version/version.go:33–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31const unknown = "<unknown>"
32
33func GetVersion() string {
34 if Version != "" {
35 return Version
36 }
37 /*
38 * go install example.com/cmd/foo@vX.Y.Z: bi.Main.Version="vX.Y.Z", vcs.revision is unset
39 * go install example.com/cmd/foo@latest: bi.Main.Version="vX.Y.Z", vcs.revision is unset
40 * go install example.com/cmd/foo@master: bi.Main.Version="vX.Y.Z-N.yyyyMMddhhmmss-gggggggggggg", vcs.revision is unset
41 * go install ./cmd/foo: bi.Main.Version="(devel)", vcs.revision="gggggggggggggggggggggggggggggggggggggggg"
42 * vcs.time="yyyy-MM-ddThh:mm:ssZ", vcs.modified=("false"|"true")
43 */
44 if bi, ok := debug.ReadBuildInfo(); ok {
45 if bi.Main.Version != "" && bi.Main.Version != "(devel)" {
46 return bi.Main.Version
47 }
48 }
49 return unknown
50}
51
52func GetRevision() string {
53 if Revision != "" {

Callers 3

ClientVersionFunction · 0.92
newAppFunction · 0.92
versionActionFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…