From 50f94b1dcd45b88c61d73fce2ec56cedc4c13b14 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Tue, 31 Mar 2026 14:43:38 -0400 Subject: cmd/go/internal/doc: follow up to CL 733200 I submitted a rebased variant of the CL that dropped changes in response to Sean Liao and Ian Alexander's comments. Add the bug updates below and re-implement Ian's suggestion. Fixes #34750 For #53446 For #60645 Change-Id: Ie132ac65efd27e811edabfbbb083b6946a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/761580 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Michael Matloob Reviewed-by: Michael Matloob Reviewed-by: Ian Alexander Reviewed-by: Dmitri Shuralyov --- src/cmd/go/internal/doc/doc.go | 2 +- src/cmd/go/internal/modload/init.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cmd') diff --git a/src/cmd/go/internal/doc/doc.go b/src/cmd/go/internal/doc/doc.go index 3ebd0f5dab..5a7c1a458c 100644 --- a/src/cmd/go/internal/doc/doc.go +++ b/src/cmd/go/internal/doc/doc.go @@ -373,7 +373,7 @@ func parseArgs(ctx context.Context, flagSet *flag.FlagSet, args []string) (pkg * } loader := modload.NewState() if testGOPATH { - loader = modload.DisabledState() + loader = modload.NewDisabledState() } if len(args) > 0 && strings.Index(args[0], "@") >= 0 { // Version query: force no root diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index e71e467d9f..515b40a00d 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -467,7 +467,7 @@ func NewState() *State { return s } -func DisabledState() *State { +func NewDisabledState() *State { fips140.Init() return &State{initialized: true, modulesEnabled: false} } -- cgit v1.3-5-g9baa