Skip to content

Commit 49e125d

Browse files
committed
gopls/doc: clarify go work use
1 parent 003fde1 commit 49e125d

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)