Skip to content

Commit

Permalink
Revert "cmd/api: treat a hex-y VERSION as devel and permit API changes"
Browse files Browse the repository at this point in the history
This reverts commit 11d1c05.
See golang#9296 for details.

Change-Id: I89a36351cb007836662f28a611af5616818b95fe
Reviewed-on: https://go-review.googlesource.com/1536
Reviewed-by: Minux Ma <[email protected]>
Reviewed-by: Russ Cox <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
dsymonds committed Feb 8, 2015
1 parent 906aefb commit c71b3e0
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/cmd/api/goapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit c71b3e0

Please sign in to comment.