Skip to content

gopls/doc: clarify go work use #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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