diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index b845842a7fa..0843e1ad4d9 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -709,17 +709,16 @@ func loadModFile(ctx context.Context) (rs *Requirements, needCommit bool) { // cfg.CmdName directly here. if cfg.BuildMod == "mod" && cfg.CmdName != "mod graph" && cfg.CmdName != "mod why" { addGoStmt(MainModules.ModFile(mainModule), mainModule, LatestGoVersion()) - if go117EnableLazyLoading { - // We need to add a 'go' version to the go.mod file, but we must assume - // that its existing contents match something between Go 1.11 and 1.16. - // Go 1.11 through 1.16 have eager requirements, but the latest Go - // version uses lazy requirements instead — so we need to cnvert the - // requirements to be lazy. - var err error - rs, err = convertDepth(ctx, rs, lazy) - if err != nil { - base.Fatalf("go: %v", err) - } + + // We need to add a 'go' version to the go.mod file, but we must assume + // that its existing contents match something between Go 1.11 and 1.16. + // Go 1.11 through 1.16 have eager requirements, but the latest Go + // version uses lazy requirements instead — so we need to convert the + // requirements to be lazy. + var err error + rs, err = convertDepth(ctx, rs, lazy) + if err != nil { + base.Fatalf("go: %v", err) } } else { rawGoVersion.Store(mainModule, modFileGoVersion(MainModules.ModFile(mainModule))) diff --git a/src/cmd/go/internal/modload/modfile.go b/src/cmd/go/internal/modload/modfile.go index 463869910c8..2606fe4425f 100644 --- a/src/cmd/go/internal/modload/modfile.go +++ b/src/cmd/go/internal/modload/modfile.go @@ -45,11 +45,6 @@ const ( ) const ( - // go117EnableLazyLoading toggles whether lazy-loading code paths should be - // active. It will be removed once the lazy loading implementation is stable - // and well-tested. - go117EnableLazyLoading = true - // go1117LazyTODO is a constant that exists only until lazy loading is // implemented. Its use indicates a condition that will need to change if the // main module is lazy. @@ -103,9 +98,6 @@ const ( ) func modDepthFromGoVersion(goVersion string) modDepth { - if !go117EnableLazyLoading { - return eager - } if semver.Compare("v"+goVersion, lazyLoadingVersionV) < 0 { return eager }