]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: improve ErrNoModRoot error text
authorMichael Matloob <matloob@golang.org>
Tue, 25 Mar 2025 18:10:31 +0000 (14:10 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 25 Mar 2025 20:48:29 +0000 (13:48 -0700)
commit87d1833c66aa25a7e495987b066bdd22d1fe3105
treee51326e004197034de36a569a65c4360e6a94dd0
parent44fef2aa4db70bfbe7bfd2abbd5b12eb776cde1d
cmd/go/internal/modload: improve ErrNoModRoot error text

Before this change, in several cases where HasModRoot() returned false,
we'd return ErrNoModRoot. ErrNoModRoot would say that there was no
go.mod file but would not mention workspaces. With this change,
ErrNoModRoot will return error text that's different if we're in a
workspace, saying that there are no modules in the workspace.

Fixes #54419

Change-Id: I77c94d0011947bf8e33c066416ab3762502fd2e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/660675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/script/work_no_mod_root_issue54419.txt [new file with mode: 0644]