Skip to content

Commit cd6f3a5

Browse files
author
Jay Conrod
committed
cmd/go: revise 'go help' documentation for modules
Module-related help pages now contain a brief summary and point to the reference documentation at golang.org/ref/mod for details. Help pages for commands like 'go get' still describe the basic usage and summarize flags but don't provide as much background detail. Fixes #41427 Fixes #43419 Change-Id: Icacd38e0f33c352c447cc5a496c99674493abde2 Reviewed-on: https://go-review.googlesource.com/c/go/+/282615 Trust: Jay Conrod <[email protected]> Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 6192b98 commit cd6f3a5

File tree

16 files changed

+212
-1448
lines changed

16 files changed

+212
-1448
lines changed

src/cmd/go/alldocs.go

Lines changed: 109 additions & 727 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/help/helpdoc.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ listed in the GOPATH environment variable.
266266
(See 'go help gopath-get' and 'go help gopath'.)
267267
268268
When using modules, downloaded packages are stored in the module cache.
269-
(See 'go help module-get' and 'go help goproxy'.)
269+
See https://golang.org/ref/mod#module-cache.
270270
271271
When using modules, an additional variant of the go-import meta tag is
272272
recognized and is preferred over those listing version control systems.
@@ -276,7 +276,8 @@ That variant uses "mod" as the vcs in the content value, as in:
276276
277277
This tag means to fetch modules with paths beginning with example.org
278278
from the module proxy available at the URL https://code.org/moduleproxy.
279-
See 'go help goproxy' for details about the proxy protocol.
279+
See https://golang.org/ref/mod#goproxy-protocol for details about the
280+
proxy protocol.
280281
281282
Import path checking
282283
@@ -483,6 +484,10 @@ See 'go help env' for details.
483484
484485
General-purpose environment variables:
485486
487+
GO111MODULE
488+
Controls whether the go command runs in module-aware mode or GOPATH mode.
489+
May be "off", "on", or "auto".
490+
See https://golang.org/ref/mod#mod-commands.
486491
GCCGO
487492
The gccgo command to run for 'go build -compiler=gccgo'.
488493
GOARCH
@@ -521,20 +526,24 @@ General-purpose environment variables:
521526
GOPATH
522527
For more details see: 'go help gopath'.
523528
GOPROXY
524-
URL of Go module proxy. See 'go help modules'.
529+
URL of Go module proxy. See https://golang.org/ref/mod#environment-variables
530+
and https://golang.org/ref/mod#module-proxy for details.
525531
GOPRIVATE, GONOPROXY, GONOSUMDB
526532
Comma-separated list of glob patterns (in the syntax of Go's path.Match)
527533
of module path prefixes that should always be fetched directly
528534
or that should not be compared against the checksum database.
529-
See 'go help private'.
535+
See https://golang.org/ref/mod#private-modules.
530536
GOROOT
531537
The root of the go tree.
532538
GOSUMDB
533539
The name of checksum database to use and optionally its public key and
534-
URL. See 'go help module-auth'.
540+
URL. See https://golang.org/ref/mod#authenticating.
535541
GOTMPDIR
536542
The directory where the go command will write
537543
temporary source files, packages, and binaries.
544+
GOVCS
545+
Lists version control commands that may be used with matching servers.
546+
See 'go help vcs'.
538547
539548
Environment variables for use with cgo:
540549

src/cmd/go/internal/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ For more about build flags, see 'go help build'.
304304
305305
For more about specifying packages, see 'go help packages'.
306306
307-
For more about modules, see 'go help modules'.
307+
For more about modules, see https://golang.org/ref/mod.
308308
`,
309309
}
310310

src/cmd/go/internal/modcmd/download.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ corresponding to this Go struct:
5252
5353
The -x flag causes download to print the commands download executes.
5454
55-
See 'go help modules' for more about module queries.
55+
See https://golang.org/ref/mod#go-mod-download for more about 'go mod download'.
56+
57+
See https://golang.org/ref/mod#version-queries for more about version queries.
5658
`,
5759
}
5860

src/cmd/go/internal/modcmd/edit.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ Note that this only describes the go.mod file itself, not other modules
122122
referred to indirectly. For the full set of modules available to a build,
123123
use 'go list -m -json all'.
124124
125-
For example, a tool can obtain the go.mod as a data structure by
126-
parsing the output of 'go mod edit -json' and can then make changes
127-
by invoking 'go mod edit' with -require, -exclude, and so on.
125+
See https://golang.org/ref/mod#go-mod-edit for more about 'go mod edit'.
128126
`,
129127
}
130128

src/cmd/go/internal/modcmd/graph.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Graph prints the module requirement graph (with replacements applied)
2626
in text form. Each line in the output has two space-separated fields: a module
2727
and one of its requirements. Each module is identified as a string of the form
2828
path@version, except for the main module, which has no @version suffix.
29+
30+
See https://golang.org/ref/mod#go-mod-graph for more about 'go mod graph'.
2931
`,
3032
Run: runGraph,
3133
}

src/cmd/go/internal/modcmd/init.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Gopkg.lock), and the current directory (if in GOPATH).
2727
2828
If a configuration file for a vendoring tool is present, init will attempt to
2929
import module requirements from it.
30+
31+
See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
3032
`,
3133
Run: runInit,
3234
}

src/cmd/go/internal/modcmd/tidy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ to standard error.
2929
3030
The -e flag causes tidy to attempt to proceed despite errors
3131
encountered while loading packages.
32+
33+
See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'.
3234
`,
3335
Run: runTidy,
3436
}

src/cmd/go/internal/modcmd/vendor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ modules and packages to standard error.
3838
3939
The -e flag causes vendor to attempt to proceed despite errors
4040
encountered while loading packages.
41+
42+
See https://golang.org/ref/mod#go-mod-vendor for more about 'go mod vendor'.
4143
`,
4244
Run: runVendor,
4345
}

src/cmd/go/internal/modcmd/verify.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ modified since being downloaded. If all the modules are unmodified,
3131
verify prints "all modules verified." Otherwise it reports which
3232
modules have been changed and causes 'go mod' to exit with a
3333
non-zero status.
34+
35+
See https://golang.org/ref/mod#go-mod-verify for more about 'go mod verify'.
3436
`,
3537
Run: runVerify,
3638
}

0 commit comments

Comments
 (0)