Skip to content

Commit

Permalink
[release-branch.go1.18] cmd/go: add links to workspaces reference and…
Browse files Browse the repository at this point in the history
… 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 1eb1f62)
Reviewed-on: https://go-review.googlesource.com/c/go/+/389914
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
matloob authored and dmitshur committed Mar 7, 2022
1 parent 40f6480 commit 0b38b02
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
22 changes: 18 additions & 4 deletions src/cmd/go/alldocs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/cmd/go/internal/workcmd/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
`,
}

Expand Down
2 changes: 2 additions & 0 deletions src/cmd/go/internal/workcmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/go/internal/workcmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/go/internal/workcmd/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
`,
}

Expand Down
8 changes: 7 additions & 1 deletion src/cmd/go/internal/workcmd/work.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ 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'.
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
Expand Down

0 comments on commit 0b38b02

Please sign in to comment.