Expand description
Go dependency extractor using tree-sitter queries.
Extracts import declarations from Go source files, handling all import forms:
- Single imports:
import "fmt" - Import blocks:
import ( "fmt"\n "os" ) - Aliased imports:
import alias "package" - Dot imports:
import . "package" - Blank imports:
import _ "package" - CGo imports:
import "C"
§Performance
Target: <5ms per file. Uses tree-sitter’s incremental parsing and query API for efficient extraction without full AST traversal.
§Module Resolution
Supports go.mod-aware path resolution, GOPATH fallback, and vendor directory mode for mapping import paths to local file paths.
Structs§
- GoDependency
Extractor - Go dependency extractor with tree-sitter query-based import extraction.
- Import
Info - Information about a single Go import statement.
Enums§
- Extraction
Error - Error types for Go dependency extraction.