Skip to content

Commit c2cea55

Browse files
new
Change-Id: I412bac099822116d691ef73159e3625de501a0cd
1 parent afeed52 commit c2cea55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cmd/dist/buildtool.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ func bootstrapBuildTools() {
142142
_, after, _ := strings.Cut(ver, "go1")
143143
if after != "" {
144144
v := strings.Split(after, ".")
145-
if len(v) > 2 {
146-
if v[0] < minBootStrapVersion[1] || v[1] < minBootStrapVersion[2] {
145+
// if go version output is go1.22.6 goos/goarch
146+
// v is ["","22","6 goos/aoarch"].
147+
if len(v) == 3 {
148+
if v[1] < minBootStrapVersion[1] || strings.Split(v[2], " ")[0] < minBootStrapVersion[2] {
147149
fatalf("requires Go 1.%s.%s or later for bootstrap", minBootStrapVersion[1], minBootStrapVersion[2])
148150
}
149151
}

0 commit comments

Comments
 (0)