Commit c71b3e0e authored by David Symonds's avatar David Symonds

Revert "cmd/api: treat a hex-y VERSION as devel and permit API changes"

This reverts commit 11d1c05f.
See #9296 for details.

Change-Id: I89a36351cb007836662f28a611af5616818b95fe
Reviewed-on: https://go-review.googlesource.com/1536Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 906aefb0
......@@ -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
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment