// 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)))
)
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.
)
func modDepthFromGoVersion(goVersion string) modDepth {
- if !go117EnableLazyLoading {
- return eager
- }
if semver.Compare("v"+goVersion, lazyLoadingVersionV) < 0 {
return eager
}