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

Function CheckCCAPIVersion

command/v7/shared/version_checker.go:10–26  ·  view source on GitHub ↗
(currentAPIVersion string)

Source from the content-addressed store, hash-verified

8)
9
10func CheckCCAPIVersion(currentAPIVersion string) (string, error) {
11 currentSemver, err := semver.Make(currentAPIVersion)
12 if err != nil {
13 return "", err
14 }
15
16 minimumSemver, err := semver.Make(ccversion.MinSupportedClientVersionV8)
17 if err != nil {
18 return "", err
19 }
20
21 if currentSemver.LT(minimumSemver) {
22 return fmt.Sprintf("\nWarning: Your targeted API's version (%s) is less than the minimum supported API version (%s). Some commands may not function correctly.", currentAPIVersion, ccversion.MinSupportedClientVersionV8), nil
23 }
24
25 return "", nil
26}

Callers 3

ExecuteMethod · 0.92
ExecuteMethod · 0.92

Calls 1

MakeMethod · 0.65

Tested by

no test coverage detected