From afc5fce28589513f243f5ffeca10bbfe2ac46b99 Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Wed, 2 Mar 2022 12:04:43 -0500 Subject: [PATCH] gopls/doc: address additional comments on workspace.md This CL addresses an additional comment from CL 388994, changing the example to move the go.work file outside of the repo. For golang/go#51206 Change-Id: I576615f9bbcc676f3f78a959ad509b9dbab3b00e Reviewed-on: https://go-review.googlesource.com/c/tools/+/389234 Trust: Robert Findley Run-TryBot: Robert Findley gopls-CI: kokoro Reviewed-by: Michael Matloob TryBot-Result: Gopher Robot --- gopls/doc/workspace.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gopls/doc/workspace.md b/gopls/doc/workspace.md index e5f7d149c6..610afbe618 100644 --- a/gopls/doc/workspace.md +++ b/gopls/doc/workspace.md @@ -32,15 +32,17 @@ The easiest way to work on multiple modules in Go 1.18 and later is therefore to create a `go.work` file containing the modules you wish to work on, and set your workspace root to the directory containing the `go.work` file. -For example, to work on both modules in this repo (`golang.org/x/tools` and -`golang.org/x/tools/gopls`), the following suffices: +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: ``` +cd $WORK go work init -go work use . gopls +go work use tools tools/gopls ``` -...followed by opening up the repo root. +...followed by opening the `$WORK` directory in our editor. #### Experimental workspace module (Go 1.17 and earlier)