MCPcopy Create free account
hub / github.com/cli/cli / versionGreaterThan

Function versionGreaterThan

internal/update/update.go:178–189  ·  view source on GitHub ↗
(v, w string)

Source from the content-addressed store, hash-verified

176}
177
178func versionGreaterThan(v, w string) bool {
179 w = gitDescribeSuffixRE.ReplaceAllStringFunc(w, func(m string) string {
180 idx := strings.IndexRune(m, '-')
181 n, _ := strconv.Atoi(m[0:idx])
182 return fmt.Sprintf("%d-pre.0", n+1)
183 })
184
185 vv, ve := version.NewVersion(v)
186 vw, we := version.NewVersion(w)
187
188 return ve == nil && we == nil && vv.GreaterThan(vw)
189}
190
191// IsTerminal determines if a file descriptor is an interactive terminal / TTY.
192func IsTerminal(f *os.File) bool {

Callers 1

CheckForUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected