Visit https://lsif.dev/ to learn about LSIF.
docker pull sourcegraph/lsif-go:v1.1.2
go get github.com/sourcegraph/lsif-go/cmd/lsif-go
After installing lsif-go onto your PATH, run the command in the root where your go.mod file is located.
$ lsif-go --verbose
✔ Loading packages... Done (846.22ms).
✔ Emitting documents... Done (87.69µs).
✔ Adding import definitions... Done (163.11µs).
✔ Preloading hover text and moniker paths... Done (85.85ms).
✔ Indexing definitions... Done (15.8ms).
✔ Indexing references... Done (12.03ms).
✔ Linking items to definitions... Done (6.83ms).
✔ Emitting contains relations... Done (210.09µs).
Stats:
Wall time elapsed: 968.11ms
Packages indexed: 14
Files indexed: 51
Definitions indexed: 1657
Elements emitted: 34040
Use lsif-go --help for more information.
To keep your index up-to-date, you can add a step to your CI to generate new data when your repository changes. See our documentation on adding LSIF to your workflows.