aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/modfile.go
diff options
context:
space:
mode:
authorBaokun Lee <bk@golangcn.org>2020-12-31 11:42:39 +0800
committerJay Conrod <jayconrod@google.com>2021-01-06 18:54:25 +0000
commitc9658bee93c169f6efd4654576bf8e9a920ec1de (patch)
tree61e15c72b8803e5ff5f5912df59c07f497897fa3 /src/cmd/go/internal/modload/modfile.go
parent4c668b25c6517ff12b61c11cad1f22ddc89a9791 (diff)
downloadgo-c9658bee93c169f6efd4654576bf8e9a920ec1de.tar.gz
go-c9658bee93c169f6efd4654576bf8e9a920ec1de.zip
cmd/go: make module suggestion more friendly
We are trying to avoid by not automatically updating go.mod. The suggestion should be that users actually add the dependencies they need, and the command in an easily copy-pastable form now. Fixes: #43430 Change-Id: I2227dab498fcd8d66184c94ebe9e776629ccadfd Reviewed-on: https://go-review.googlesource.com/c/go/+/280713 Run-TryBot: Baokun Lee <bk@golangcn.org> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Trust: Jay Conrod <jayconrod@google.com> Trust: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/modfile.go')
-rw-r--r--src/cmd/go/internal/modload/modfile.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/modfile.go b/src/cmd/go/internal/modload/modfile.go
index d5a17236cd..c6667d0bf7 100644
--- a/src/cmd/go/internal/modload/modfile.go
+++ b/src/cmd/go/internal/modload/modfile.go
@@ -449,7 +449,7 @@ func goModSummary(m module.Version) (*modFileSummary, error) {
if HasModRoot() && cfg.BuildMod == "readonly" && actual.Version != "" {
key := module.Version{Path: actual.Path, Version: actual.Version + "/go.mod"}
if !modfetch.HaveSum(key) {
- suggestion := fmt.Sprintf("; try 'go mod download %s' to add it", m.Path)
+ suggestion := fmt.Sprintf("; to add it:\n\tgo mod download %s", m.Path)
return nil, module.VersionError(actual, &sumMissingError{suggestion: suggestion})
}
}