aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/init.go
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2021-01-07 11:14:06 -0500
committerJay Conrod <jayconrod@google.com>2021-01-08 20:19:51 +0000
commit6192b9875128c5f53a69b959d5a1abf0f10ae93f (patch)
treec39777eb78c5c3309578cd8bd7758989fd9901ac /src/cmd/go/internal/modload/init.go
parent25886cf4bd28be373afb80a4c068a785b43bdddf (diff)
downloadgo-6192b9875128c5f53a69b959d5a1abf0f10ae93f.tar.gz
go-6192b9875128c5f53a69b959d5a1abf0f10ae93f.zip
cmd/go: make hints in error messages more consistent
* All commands the user can run to fix the problem now appear alone on a separate line after a tab. * Removed -d from 'go get' commands. * Replaced 'go mod tidy' with 'go mod download $modpath' when a package might be provided by a module missing a sum. * Errors about 'path@version' syntax are more explicit. Fixes #29415 Fixes #42087 Fixes #43430 Fixes #43523 Change-Id: I4427c2c4506a727a2c727d652fd2d506bb134d3b Reviewed-on: https://go-review.googlesource.com/c/go/+/282121 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/init.go')
-rw-r--r--src/cmd/go/internal/modload/init.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
index 1a51c58bf2..bc8d17e0a5 100644
--- a/src/cmd/go/internal/modload/init.go
+++ b/src/cmd/go/internal/modload/init.go
@@ -380,7 +380,7 @@ func LoadModFile(ctx context.Context) {
if f.Module == nil {
// No module declaration. Must add module path.
- base.Fatalf("go: no module declaration in go.mod.\n\tRun 'go mod edit -module=example.com/mod' to specify the module path.")
+ base.Fatalf("go: no module declaration in go.mod. To specify the module path:\n\tgo mod edit -module=example.com/mod")
}
if err := checkModulePathLax(f.Module.Mod.Path); err != nil {