aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/alldocs.go
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2020-10-12 12:03:43 -0400
committerJay Conrod <jayconrod@google.com>2020-11-16 22:24:14 +0000
commit869e2957b9f66021581b839cadce6cb48ad46114 (patch)
tree105965fbb46b8e3c63df7d9c390dfbb03d4bc95c /src/cmd/go/alldocs.go
parent97700baf8bd5c0fdbfe38eedc80d3c612805cbda (diff)
downloadgo-869e2957b9f66021581b839cadce6cb48ad46114.tar.gz
go-869e2957b9f66021581b839cadce6cb48ad46114.zip
cmd/go: update 'go help mod init'
'go help mod init' now mentions that the module path can be derived from the directory within GOPATH. We no longer mention version control, since that's now ignored. Fixes #36775 Change-Id: Ia5559ecb537fccd838eeab84517e76aa01989292 Reviewed-on: https://go-review.googlesource.com/c/go/+/261539 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r--src/cmd/go/alldocs.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index 47076570a6..81f404c0ef 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1230,12 +1230,17 @@
//
// go mod init [module]
//
-// Init initializes and writes a new go.mod to the current directory,
-// in effect creating a new module rooted at the current directory.
-// The file go.mod must not already exist.
-// If possible, init will guess the module path from import comments
-// (see 'go help importpath') or from version control configuration.
-// To override this guess, supply the module path as an argument.
+// Init initializes and writes a new go.mod file in the current directory, in
+// effect creating a new module rooted at the current directory. The go.mod file
+// must not already exist.
+//
+// Init accepts one optional argument, the module path for the new module. If the
+// module path argument is omitted, init will attempt to infer the module path
+// using import comments in .go files, vendoring tool configuration files (like
+// Gopkg.lock), and the current directory (if in GOPATH).
+//
+// If a configuration file for a vendoring tool is present, init will attempt to
+// import module requirements from it.
//
//
// Add missing and remove unused modules