doc: update zoekt local dev to use go workspaces (#40790)

Go workspaces provide a more convenient way to do development against
local modules. This updates the zoekt documentation to use that instead
of a module replace directive.

Test Plan: ran documented commands
This commit is contained in:
Keegan Carruthers-Smith 2022-08-24 21:03:44 +02:00 committed by GitHub
parent 5a64eaf66b
commit 0be22214ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,22 +5,25 @@ $ git clone https://github.com/sourcegraph/sourcegraph
$ git clone https://github.com/sourcegraph/zoekt
```
To see your Zoekt changes reflected live on your local Sourcegraph instance, you'll have to modify your
Sourcegraph `go.mod` file so that the Zoekt dependency is pointed to your local folder.
Change at the bottom:
To see your Zoekt changes reflected live on your local Sourcegraph instance you can use [go workspaces](https://go.dev/ref/mod#workspaces):
```
replace (
...
github.com/sourcegraph/zoekt => <your zoekt repository directory>
...
$ cd sourcegraph
$ go work init . ../zoekt
$ cat go.work
go 1.19
use (
.
../zoekt
)
```
This isn't hot reloaded so you might have to restart Sourcegraph on every Zoekt change. It may make sense to ensure your
changes in Zoekt are working first before trying them out in Sourcegraph.
When you are done do not forget to remove your `go.work` file.
## Install Ctags
Ctags is not required for Zoekt. However, we use ctags in production and tests on CI run with ctags enabled.