MCPcopy
hub / github.com/cloudfoundry/cli / VersionString

Function VersionString

version/version.go:38–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38func VersionString() string {
39 if customVersion != "" {
40 return customVersion
41 }
42
43 // Remove the "v" prefix from the binary in case it is present
44 binaryVersion = strings.TrimPrefix(binaryVersion, "v")
45 versionString, err := semver.Make(binaryVersion)
46 if err != nil {
47 versionString = semver.MustParse(DefaultVersion)
48 }
49
50 metaData := []string{}
51 if binarySHA != "" {
52 metaData = append(metaData, binarySHA)
53 }
54
55 if binaryBuildDate != "" {
56 metaData = append(metaData, binaryBuildDate)
57 }
58
59 versionString.Build = metaData
60
61 return versionString.String()
62}

Callers 9

IsMinCliVersionMethod · 0.92
version_test.goFile · 0.92
ExecuteMethod · 0.92
CLIVersionMethod · 0.92
newRequestMethod · 0.92
gateway_test.goFile · 0.92
newAppPresenterFunction · 0.92
BinaryVersionMethod · 0.92
HandlePanicFunction · 0.92

Calls 2

MakeMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected