File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -167,12 +167,14 @@ func Select() {
167
167
gover .Startup .AutoToolchain = toolchain
168
168
} else {
169
169
if toolchain != "" {
170
- // Accept toolchain only if it is >= our min.
170
+ // Accept toolchain only if it is > our min.
171
+ // (If it is equal, then min satisfies it anyway: that can matter if min
172
+ // has a suffix like "go1.21.1-foo" and toolchain is "go1.21.1".)
171
173
toolVers := gover .FromToolchain (toolchain )
172
174
if toolVers == "" || (! strings .HasPrefix (toolchain , "go" ) && ! strings .Contains (toolchain , "-go" )) {
173
175
base .Fatalf ("invalid toolchain %q in %s" , toolchain , base .ShortPath (file ))
174
176
}
175
- if gover .Compare (toolVers , minVers ) >= 0 {
177
+ if gover .Compare (toolVers , minVers ) > 0 {
176
178
gotoolchain = toolchain
177
179
minVers = toolVers
178
180
gover .Startup .AutoToolchain = toolchain
Original file line number Diff line number Diff line change @@ -163,12 +163,25 @@ go mod edit -go=1.499 -toolchain=none
163
163
go version
164
164
stdout go1.500-bigcorp
165
165
166
+ go mod edit -go=1.499 -toolchain=go1.499
167
+ go version
168
+ stdout go1.500-bigcorp
169
+
166
170
go mod edit -go=1.500 -toolchain=none
167
171
go version
168
172
stdout go1.500-bigcorp
169
173
174
+ go mod edit -go=1.500 -toolchain=go1.500
175
+ go version
176
+ stdout go1.500-bigcorp
177
+
170
178
go mod edit -go=1.501 -toolchain=none
171
179
go version
180
+ stdout go1.501
181
+
182
+ # If toolchain > go, we must upgrade to the indicated toolchain (not just the go version).
183
+ go mod edit -go=1.499 -toolchain=go1.501
184
+ go version
172
185
stdout go1.501
173
186
174
187
env TESTGO_VERSION='go1.500 (bigcorp)'
You can’t perform that action at this time.
0 commit comments