Go spelunking! CLI tool to quickly find things in Go projects.
- Things might change
- Things might break
Once you have installed Go, run this:
go install github.com/wedaly/gospelunk@latest
To list definitions in Go packages:
gospelunk list ./...
- You can specify packages using the same format as other go commands. See
go help packagesfor details. - You can use the
--templateparameter to customize the Go template used to render the output. - Use
--include-privateto include non-exported definitions. - Use
--include-teststo include definitions from "_test.go" files.
To lookup type information, definitions, and references for an identifier in a Go file:
gospelunk inspect -f <FILE> -l <LINE> -c <COLUMN>
- Line and column numbers are 1-indexed, and the column unit is bytes.
- The
--relationKindsparameter controls which relations are loaded (definitions, references, or implementations). - The
--searchDirparameter controls where gospelunk searches for references and interface implementations. - You can use the
--templateparameter to customize the Go template used to render the output.