]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make ErrNoModRoot work with local state
authorIan Alexander <jitsu@google.com>
Fri, 3 Oct 2025 04:31:26 +0000 (00:31 -0400)
committerIan Alexander <jitsu@google.com>
Fri, 24 Oct 2025 14:25:52 +0000 (07:25 -0700)
commitc18fa69e528f1679cd9b4c1c04a95f048c68000e
tree3680e8ebdd79eb62847d86ea9c698a876b887f19
parent296ecc918d6688b5eeb9abe32d919b0aaa76d798
cmd/go: make ErrNoModRoot work with local state

This change reworks the sentinel error value ErrNoModRoot and the type
noMainModulesError so that we can determine the appropriate error
message to display based on the loader state without depending on the
state directly.

This commit is part of the overall effort to eliminate global
modloader state.

Change-Id: I64de433faca96ed90fad4c153766c50575a72157
Reviewed-on: https://go-review.googlesource.com/c/go/+/711120
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modget/query.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/list.go