-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
pkg:corepackages/core - indexer, scanner, vectorpackages/core - indexer, scanner, vectortype:featureNew functionalityNew functionality
Description
Summary
Complete Go scanner integration into the scanner registry with comprehensive test coverage and production hardening.
Background
Part of Epic #128: Go Language Support
Depends on: #129 (Core Scanner), #130 (Methods & Generics)
Tasks
Registry Integration
- Register
GoScannerincreateDefaultRegistry() - Add
.goto supported extensions list - Update scanner auto-detection logic
- Export from
packages/core/src/scanner/index.ts
Generated File Handling
- Skip files starting with
// Code generated - Skip
vendor/directory - Skip common build artifacts (
bin/,dist/) - Add
isGenerateddetection helper
Test Coverage (Target: 90%+)
- Unit tests for all extraction types
- Edge cases: empty files, syntax errors, partial files
- Generated file skip logic tests
- Integration test with realistic Go project structure
- Test file detection (
*_test.go→isTest: true)
Documentation
- Update
packages/core/src/scanner/README.mdwith Go section - Add Go input/output examples
- Document supported constructs table
- Add troubleshooting notes
Edge Cases
- Handle build tags:
//go:build linux - Handle blank identifiers:
var _ Interface = (*Impl)(nil) - Handle init functions:
func init() {} - Handle embedded structs
- Handle multiple declarations:
var a, b, c int
Acceptance Criteria
- Go scanner registered in default registry
-
dev index .works on Go repositories out of the box - Generated files (
.gen.go,.pb.go) are skipped - Test coverage ≥ 90% (matching TypeScript scanner)
- README updated with Go documentation
- All edge cases handled gracefully (no crashes)
Test File Structure
packages/core/src/scanner/
├── go.ts # GoScanner implementation
├── go.test.ts # Comprehensive test suite
├── __fixtures__/
│ └── go/
│ ├── simple.go # Basic functions, structs
│ ├── methods.go # Receiver methods
│ ├── generics.go # Generic types and functions
│ ├── generated.go # Should be skipped
│ └── edge-cases.go # Build tags, init, embedded
References
- TypeScript scanner coverage: 94.94%
- Scanner test patterns:
packages/core/src/scanner/scanner.test.ts
Metadata
Metadata
Assignees
Labels
pkg:corepackages/core - indexer, scanner, vectorpackages/core - indexer, scanner, vectortype:featureNew functionalityNew functionality