(v, w string)
| 167 | } |
| 168 | |
| 169 | func versionGreaterThan(v, w string) bool { |
| 170 | w = gitDescribeSuffixRE.ReplaceAllStringFunc(w, func(m string) string { |
| 171 | idx := strings.IndexRune(m, '-') |
| 172 | n, _ := strconv.Atoi(m[0:idx]) |
| 173 | return fmt.Sprintf("%d-pre.0", n+1) |
| 174 | }) |
| 175 | |
| 176 | vv, ve := version.NewVersion(v) |
| 177 | vw, we := version.NewVersion(w) |
| 178 | |
| 179 | return ve == nil && we == nil && vv.GreaterThan(vw) |
| 180 | } |
| 181 | |
| 182 | // IsTerminal determines if a file descriptor is an interactive terminal / TTY. |
| 183 | func IsTerminal(f *os.File) bool { |