}
}
-var (
- internalPkg = regexp.MustCompile(`(^|/)internal($|/)`)
- hashRx = regexp.MustCompile(`^[0-9a-f]{7,40}$`)
-)
-
-func isDevelVersion(v string) bool {
- if strings.Contains(v, "devel") {
- return true
- }
- return hashRx.MatchString(v)
-}
+var internalPkg = regexp.MustCompile(`(^|/)internal($|/)`)
func main() {
flag.Parse()
- if v := runtime.Version(); !strings.Contains(v, "weekly") && !isDevelVersion(v) {
+ if !strings.Contains(runtime.Version(), "weekly") && !strings.Contains(runtime.Version(), "devel") {
if *nextFile != "" {
fmt.Printf("Go version is %q, ignoring -next %s\n", runtime.Version(), *nextFile)
*nextFile = ""
delete(optionalSet, newFeature)
} else {
fmt.Fprintf(w, "+%s\n", newFeature)
- if !*allowNew || !isDevelVersion(runtime.Version()) {
+ if !*allowNew || !strings.Contains(runtime.Version(), "devel") {
ok = false // we're in lock-down mode for next release
}
}