Skip to content

Commit 9474ca3

Browse files
angazfindleyr
authored andcommitted
gopls/doc: clarify go work use
I felt a bit confused on my first reading of the docs for using `go work`. It wasn't clear to me if the `tools` argument in `go work use tools tools/gopls` was an alias or a directory name, so I thought this might make it very clear to understand for first time users. Change-Id: I9c5a04a8928207b53acfb36ce7add8ca5f033d46 GitHub-Last-Rev: 49e125d GitHub-Pull-Request: #409 Reviewed-on: https://go-review.googlesource.com/c/tools/+/441415 TryBot-Result: Gopher Robot <[email protected]> gopls-CI: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> Reviewed-by: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]>
1 parent 003fde1 commit 9474ca3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gopls/doc/workspace.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ your workspace root to the directory containing the `go.work` file.
3434

3535
For example, suppose this repo is checked out into the `$WORK/tools` directory.
3636
We can work on both `golang.org/x/tools` and `golang.org/x/tools/gopls`
37-
simultaneously by creating a `go.work` file:
37+
simultaneously by creating a `go.work` file using `go work init`, followed by
38+
`go work use MODULE_DIRECTORIES...` to add directories containing `go.mod` files to the
39+
workspace:
3840

39-
```
41+
```sh
4042
cd $WORK
4143
go work init
42-
go work use tools tools/gopls
44+
go work use ./tools/ ./tools/gopls/
4345
```
4446

4547
...followed by opening the `$WORK` directory in our editor.

0 commit comments

Comments
 (0)