- Build:
go build ./cmd/scip-go - Test all:
go test ./... - Test single package:
go test ./internal/index - Update snapshots:
go test ./internal/index -update-snapshots - Install:
go install ./cmd/scip-go - Version check:
go version(uses Go 1.24.3)
- Snapshot testing: Primary testing method using
internal/testdata/snapshotsdirectory withinternal/index/scip_test.goas the test runner - Test data: Located in
internal/testdata/with test cases as subdirectories - Update snapshots: Run with
-update-snapshotsflag to regenerate expected outputs - Filter tests: Use
-filter <name>to run specific test cases
SCIP (Source Code Intelligence Protocol) indexer for Go. Main entry point is
cmd/scip-go/main.go. Key packages: internal/index (core indexing),
internal/loader (package loading), internal/visitors (AST traversal),
internal/document (SCIP document generation).
- Package naming: lowercase, single word preferred (e.g.,
index,loader,symbols) - Imports: grouped by std library, third-party, then internal packages with blank lines
- Test files: use
package_testconvention for black-box testing - Embed files: use
//go:embedfor version.txt and similar resources - Error handling: return explicit errors, no panics in library code
- Logging: use
charmbracelet/logfor structured logging