Skip to content

Commit cfd04a1

Browse files
committed
gopls/doc: clarify go work use
1 parent 350f1e2 commit cfd04a1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

gopls/doc/workspace.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ 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
3839

39-
```
40+
workspace:
41+
42+
```sh
4043
cd $WORK
4144
go work init
42-
go work use tools tools/gopls
45+
go work use ./tools/ ./tools/gopls/
4346
```
4447

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

0 commit comments

Comments
 (0)