[release-branch.go1.18] cmd/go: add links to workspaces reference and tutorial to go help work

For #45713

Change-Id: Ia2901cbfc5deb52503e74fcf9dff26a56ec582c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/389297
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 1eb1f621da)
Reviewed-on: https://go-review.googlesource.com/c/go/+/389914
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Michael Matloob 2022-03-03 16:18:31 -05:00 committed by Dmitri Shuralyov
parent 40f6480db6
commit 0b38b0277e
6 changed files with 35 additions and 8 deletions

View File

@ -1356,7 +1356,7 @@
//
// Workspace maintenance
//
// Go workspace provides access to operations on workspaces.
// Work provides access to operations on workspaces.
//
// Note that support for workspaces is built into many other commands, not
// just 'go work'.
@ -1364,6 +1364,12 @@
// See 'go help modules' for information about Go's module system of which
// workspaces are a part.
//
// See https://go.dev/ref/mod#workspaces for an in-depth reference on
// workspaces.
//
// See https://go.dev/doc/tutorial/workspaces for an introductory
// tutorial on workspaces.
//
// A workspace is specified by a go.work file that specifies a set of
// module directories with the "use" directive. These modules are used as
// root modules by the go command for builds and related operations. A
@ -1485,9 +1491,8 @@
// Version string
// }
//
// See the workspaces design proposal at
// https://go.googlesource.com/proposal/+/master/design/45713-workspace.md for
// more information.
// See the workspaces reference at https://go.dev/ref/mod#workspaces
// for more information.
//
//
// Initialize workspace file
@ -1507,6 +1512,9 @@
// Each argument path is added to a use directive in the go.work file. The
// current go version will also be listed in the go.work file.
//
// See the workspaces reference at https://go.dev/ref/mod#workspaces
// for more information.
//
//
// Sync workspace build list to modules
//
@ -1530,6 +1538,9 @@
// build list's version of each module is always the same or higher than
// that in each workspace module.
//
// See the workspaces reference at https://go.dev/ref/mod#workspaces
// for more information.
//
//
// Add modules to workspace file
//
@ -1549,6 +1560,9 @@
// were specified as arguments: namely, use directives will be added for
// directories that exist, and removed for directories that do not exist.
//
// See the workspaces reference at https://go.dev/ref/mod#workspaces
// for more information.
//
//
// Compile and run Go program
//

View File

@ -84,9 +84,8 @@ writing it back to go.mod. The JSON output corresponds to these Go types:
Version string
}
See the workspaces design proposal at
https://go.googlesource.com/proposal/+/master/design/45713-workspace.md for
more information.
See the workspaces reference at https://go.dev/ref/mod#workspaces
for more information.
`,
}

View File

@ -27,6 +27,8 @@ modules will be created.
Each argument path is added to a use directive in the go.work file. The
current go version will also be listed in the go.work file.
See the workspaces reference at https://go.dev/ref/mod#workspaces
for more information.
`,
Run: runInit,
}

View File

@ -33,6 +33,9 @@ if the dependency module's version is not already the same as the build
list's version. Note that Minimal Version Selection guarantees that the
build list's version of each module is always the same or higher than
that in each workspace module.
See the workspaces reference at https://go.dev/ref/mod#workspaces
for more information.
`,
Run: runSync,
}

View File

@ -33,6 +33,9 @@ The -r flag searches recursively for modules in the argument
directories, and the use command operates as if each of the directories
were specified as arguments: namely, use directives will be added for
directories that exist, and removed for directories that do not exist.
See the workspaces reference at https://go.dev/ref/mod#workspaces
for more information.
`,
}

View File

@ -12,7 +12,7 @@ import (
var CmdWork = &base.Command{
UsageLine: "go work",
Short: "workspace maintenance",
Long: `Go workspace provides access to operations on workspaces.
Long: `Work provides access to operations on workspaces.
Note that support for workspaces is built into many other commands, not
just 'go work'.
@ -20,6 +20,12 @@ just 'go work'.
See 'go help modules' for information about Go's module system of which
workspaces are a part.
See https://go.dev/ref/mod#workspaces for an in-depth reference on
workspaces.
See https://go.dev/doc/tutorial/workspaces for an introductory
tutorial on workspaces.
A workspace is specified by a go.work file that specifies a set of
module directories with the "use" directive. These modules are used as
root modules by the go command for builds and related operations. A