github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v7/shared/version_checker.go (about) 1 package shared 2 3 import ( 4 "fmt" 5 6 "github.com/blang/semver" 7 ) 8 9 const minimumCCAPIVersionForV7 = "3.85.0" 10 11 func CheckCCAPIVersion(currentAPIVersion string) (string, error) { 12 currentSemver, err := semver.Make(currentAPIVersion) 13 if err != nil { 14 return "", err 15 } 16 17 minimumSemver, err := semver.Make(minimumCCAPIVersionForV7) 18 if err != nil { 19 return "", err 20 } 21 22 if currentSemver.LT(minimumSemver) { 23 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, minimumCCAPIVersionForV7), nil 24 } 25 26 return "", nil 27 }