gopls/doc: address additional comments on workspace.md

This CL addresses an additional comment from CL 388994, changing the
example to move the go.work file outside of the repo.

For golang/go#51206

Change-Id: I576615f9bbcc676f3f78a959ad509b9dbab3b00e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/389234
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Robert Findley 2022-03-02 12:04:43 -05:00
parent abbbcaf758
commit afc5fce285
1 changed files with 6 additions and 4 deletions

View File

@ -32,15 +32,17 @@ The easiest way to work on multiple modules in Go 1.18 and later is therefore
to create a `go.work` file containing the modules you wish to work on, and set
your workspace root to the directory containing the `go.work` file.
For example, to work on both modules in this repo (`golang.org/x/tools` and
`golang.org/x/tools/gopls`), the following suffices:
For example, suppose this repo is checked out into the `$WORK/tools` directory.
We can work on both `golang.org/x/tools` and `golang.org/x/tools/gopls`
simultaneously by creating a `go.work` file:
```
cd $WORK
go work init
go work use . gopls
go work use tools tools/gopls
```
...followed by opening up the repo root.
...followed by opening the `$WORK` directory in our editor.
#### Experimental workspace module (Go 1.17 and earlier)