]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/modload: remove go117EnableLazyLoading
authorBryan C. Mills <bcmills@google.com>
Fri, 27 Aug 2021 18:26:31 +0000 (14:26 -0400)
committerBryan C. Mills <bcmills@google.com>
Mon, 30 Aug 2021 20:08:26 +0000 (20:08 +0000)
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>
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/modfile.go

index b845842a7fa4c91465cd9164df63663d957c47f2..0843e1ad4d9349deebb00f43d0f78586d74fa147 100644 (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)))
index 463869910c857f3448c57455893ee58b387a10df..2606fe4425fcd1f4bb5c1ce95c6a87c90d2794b3 100644 (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
        }