mirror of
https://github.com/golang/go
synced 2024-11-12 08:10:21 -07:00
cmd/compile: correct check for valid -lang version
Change-Id: Iad10d0a2dbc8e12e9f776c6cfb34070f584fd439 Reviewed-on: https://go-review.googlesource.com/c/149057 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This commit is contained in:
parent
5d39260079
commit
7ebe35093d
@ -41,6 +41,11 @@ func TestInvalidLang(t *testing.T) {
|
||||
t.Error("compilation with -lang=go9.99 succeeded unexpectedly")
|
||||
}
|
||||
|
||||
// This test will have to be adjusted if we ever reach 1.99 or 2.0.
|
||||
if testLang(t, "go1.99", src, outfile) == nil {
|
||||
t.Error("compilation with -lang=go1.99 succeeded unexpectedly")
|
||||
}
|
||||
|
||||
if testLang(t, "go1.8", src, outfile) == nil {
|
||||
t.Error("compilation with -lang=go1.8 succeeded unexpectedly")
|
||||
}
|
||||
|
@ -1444,7 +1444,7 @@ func checkLang() {
|
||||
if err != nil {
|
||||
log.Fatalf("internal error parsing default lang %q: %v", def, err)
|
||||
}
|
||||
if langWant.major > defVers.major || (langWant.major == defVers.major && langWant.major > defVers.minor) {
|
||||
if langWant.major > defVers.major || (langWant.major == defVers.major && langWant.minor > defVers.minor) {
|
||||
log.Fatalf("invalid value %q for -lang: max known version is %q", flag_lang, def)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user