]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "cmd/api: treat a hex-y VERSION as devel and permit API changes"
authorDavid Symonds <dsymonds@golang.org>
Mon, 15 Dec 2014 00:08:37 +0000 (11:08 +1100)
committerDavid Symonds <dsymonds@golang.org>
Sun, 8 Feb 2015 20:44:22 +0000 (20:44 +0000)
This reverts commit 11d1c05.
See #9296 for details.

Change-Id: I89a36351cb007836662f28a611af5616818b95fe
Reviewed-on: https://go-review.googlesource.com/1536
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/api/goapi.go

index 1519d96ccc537b06369475399240474ef2272921..85988e3bb7e6103c2f4a917f37c4b973bdadb308 100644 (file)
@@ -107,22 +107,12 @@ func setContexts() {
        }
 }
 
-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 = ""
@@ -293,7 +283,7 @@ func compareAPI(w io.Writer, features, required, optional, exception []string) (
                                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
                                }
                        }