Skip to content

Commit 6440a08

Browse files
committed
fix usage ov version.Lang
1 parent 2bdfc57 commit 6440a08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cmd/fix/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ func main() {
7171
flag.Parse()
7272

7373
if *goVersionStr != "" {
74-
if !strings.HasPrefix(*goVersionStr, "go") {
74+
if !version.IsValid(*goVersionStr) {
7575
report(fmt.Errorf("invalid -go=%s", *goVersionStr))
7676
os.Exit(exitCode)
7777
}
78-
majorStr := version.Lang(*goVersionStr)
78+
majorStr := version.Lang(*goVersionStr)[len("go"):]
7979
minorStr := "0"
8080
if before, after, found := strings.Cut(majorStr, "."); found {
8181
majorStr, minorStr = before, after

0 commit comments

Comments
 (0)