mirror of
https://github.com/golang/go.git
synced 2025-11-05 11:10:58 +00:00
cmd/api: treat a hex-y VERSION as devel and permit API changes
Change-Id: I2b05b7ff217586851ab41744e3077fddc480253c Reviewed-on: https://go-review.googlesource.com/1405 Reviewed-by: David Symonds <dsymonds@golang.org>
This commit is contained in:
parent
082a2374fb
commit
11d1c05fee
1 changed files with 13 additions and 3 deletions
|
|
@ -107,12 +107,22 @@ func setContexts() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var internalPkg = regexp.MustCompile(`(^|/)internal($|/)`)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if !strings.Contains(runtime.Version(), "weekly") && !strings.Contains(runtime.Version(), "devel") {
|
if v := runtime.Version(); !strings.Contains(v, "weekly") && !isDevelVersion(v) {
|
||||||
if *nextFile != "" {
|
if *nextFile != "" {
|
||||||
fmt.Printf("Go version is %q, ignoring -next %s\n", runtime.Version(), *nextFile)
|
fmt.Printf("Go version is %q, ignoring -next %s\n", runtime.Version(), *nextFile)
|
||||||
*nextFile = ""
|
*nextFile = ""
|
||||||
|
|
@ -283,7 +293,7 @@ func compareAPI(w io.Writer, features, required, optional, exception []string) (
|
||||||
delete(optionalSet, newFeature)
|
delete(optionalSet, newFeature)
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(w, "+%s\n", newFeature)
|
fmt.Fprintf(w, "+%s\n", newFeature)
|
||||||
if !*allowNew || !strings.Contains(runtime.Version(), "devel") {
|
if !*allowNew || !isDevelVersion(runtime.Version()) {
|
||||||
ok = false // we're in lock-down mode for next release
|
ok = false // we're in lock-down mode for next release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue