diff --git a/src/cmd/go/internal/toolchain/select.go b/src/cmd/go/internal/toolchain/select.go index 86aa89dd7d..e7201e2f5f 100644 --- a/src/cmd/go/internal/toolchain/select.go +++ b/src/cmd/go/internal/toolchain/select.go @@ -285,6 +285,7 @@ func Select() { counterSelectExec.Inc() Exec(moduleLoaderState, gotoolchain) + panic("unreachable") } var counterSelectExec = counter.New("go/toolchain/select-exec") @@ -352,12 +353,6 @@ func Exec(s *modload.State, gotoolchain string) { base.Fatalf("cannot find %q in PATH", gotoolchain) } - // Set up modules without an explicit go.mod, to download distribution. - s.Reset() - s.ForceUseModules = true - s.RootMode = modload.NoRoot - modload.Init(s) - // Download and unpack toolchain module into module cache. // Note that multiple go commands might be doing this at the same time, // and that's OK: the module cache handles that case correctly.