aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/init.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/init.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/init.go')
-rw-r--r--src/cmd/go/internal/modload/init.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
index b0acb7b25d..348c8e66c9 100644
--- a/src/cmd/go/internal/modload/init.go
+++ b/src/cmd/go/internal/modload/init.go
@@ -458,7 +458,7 @@ func CreateModFile(ctx context.Context, modPath string) {
}
}
if !empty {
- fmt.Fprintf(os.Stderr, "go: run 'go mod tidy' to add module requirements and sums\n")
+ fmt.Fprintf(os.Stderr, "go: to add module requirements and sums:\n\tgo mod tidy\n")
}
}
@@ -907,7 +907,7 @@ func WriteGoMod() {
} else if cfg.BuildModReason != "" {
base.Fatalf("go: updates to go.mod needed, disabled by -mod=readonly\n\t(%s)", cfg.BuildModReason)
} else {
- base.Fatalf("go: updates to go.mod needed; try 'go mod tidy' first")
+ base.Fatalf("go: updates to go.mod needed; to update it:\n\tgo mod tidy")
}
}