Skip to content

Commit 9da7cca

Browse files
author
Bryan C. Mills
committed
cmd/go/internal/modload: remove go117EnableLazyLoading
Updates #36460 Change-Id: I19f375f58f118e83a2615a29bbbb3853f059f0bb Reviewed-on: https://go-review.googlesource.com/c/go/+/345391 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
1 parent bdc1bef commit 9da7cca

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

src/cmd/go/internal/modload/init.go

+10-11
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,16 @@ func loadModFile(ctx context.Context) (rs *Requirements, needCommit bool) {
709709
// cfg.CmdName directly here.
710710
if cfg.BuildMod == "mod" && cfg.CmdName != "mod graph" && cfg.CmdName != "mod why" {
711711
addGoStmt(MainModules.ModFile(mainModule), mainModule, LatestGoVersion())
712-
if go117EnableLazyLoading {
713-
// We need to add a 'go' version to the go.mod file, but we must assume
714-
// that its existing contents match something between Go 1.11 and 1.16.
715-
// Go 1.11 through 1.16 have eager requirements, but the latest Go
716-
// version uses lazy requirements instead — so we need to cnvert the
717-
// requirements to be lazy.
718-
var err error
719-
rs, err = convertDepth(ctx, rs, lazy)
720-
if err != nil {
721-
base.Fatalf("go: %v", err)
722-
}
712+
713+
// We need to add a 'go' version to the go.mod file, but we must assume
714+
// that its existing contents match something between Go 1.11 and 1.16.
715+
// Go 1.11 through 1.16 have eager requirements, but the latest Go
716+
// version uses lazy requirements instead — so we need to convert the
717+
// requirements to be lazy.
718+
var err error
719+
rs, err = convertDepth(ctx, rs, lazy)
720+
if err != nil {
721+
base.Fatalf("go: %v", err)
723722
}
724723
} else {
725724
rawGoVersion.Store(mainModule, modFileGoVersion(MainModules.ModFile(mainModule)))

src/cmd/go/internal/modload/modfile.go

-8
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ const (
4545
)
4646

4747
const (
48-
// go117EnableLazyLoading toggles whether lazy-loading code paths should be
49-
// active. It will be removed once the lazy loading implementation is stable
50-
// and well-tested.
51-
go117EnableLazyLoading = true
52-
5348
// go1117LazyTODO is a constant that exists only until lazy loading is
5449
// implemented. Its use indicates a condition that will need to change if the
5550
// main module is lazy.
@@ -103,9 +98,6 @@ const (
10398
)
10499

105100
func modDepthFromGoVersion(goVersion string) modDepth {
106-
if !go117EnableLazyLoading {
107-
return eager
108-
}
109101
if semver.Compare("v"+goVersion, lazyLoadingVersionV) < 0 {
110102
return eager
111103
}

0 commit comments

Comments
 (0)