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 <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
Bryan C. Mills 2021-08-27 14:26:31 -04:00
parent bdc1bef8a0
commit 9da7ccab58
2 changed files with 10 additions and 19 deletions

View file

@ -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)))

View file

@ -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
}