1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:54:40 -07:00

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

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>
This commit is contained in:
David Symonds 2014-12-15 11:08:37 +11:00
parent 906aefb038
commit c71b3e0e88

View 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
}
}