Skip to content

Commit

Permalink
gopls/doc: clarify go work use
Browse files Browse the repository at this point in the history
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 <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
  • Loading branch information
angaz authored and findleyr committed Nov 8, 2022
1 parent 003fde1 commit 9474ca3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gopls/doc/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ your workspace root to the directory containing the `go.work` file.

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:
simultaneously by creating a `go.work` file using `go work init`, followed by
`go work use MODULE_DIRECTORIES...` to add directories containing `go.mod` files to the
workspace:

```
```sh
cd $WORK
go work init
go work use tools tools/gopls
go work use ./tools/ ./tools/gopls/
```

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

0 comments on commit 9474ca3

Please sign in to comment.