6 releases
| 0.1.5 | Jan 31, 2026 |
|---|---|
| 0.1.4 | Jan 31, 2026 |
| 0.1.2 | Dec 15, 2025 |
| 0.1.0 | Nov 6, 2025 |
#59 in #golang
250KB
5K
SLoC
codegraph-go
Go parser for CodeGraph - extracts code entities and relationships from Go source files.
Features
- Parse Go source files
- Extract functions, structs, interfaces, and packages
- Track relationships (calls, imports, interface implementations)
- Full integration with codegraph-parser-api
Quick Start
use codegraph_go::GoParser;
use codegraph_parser_api::CodeParser;
use codegraph::CodeGraph;
use std::path::Path;
let mut graph = CodeGraph::in_memory()?;
let parser = GoParser::new();
let file_info = parser.parse_file(Path::new("main.go"), &mut graph)?;
println!("Parsed {} functions", file_info.functions.len());
codegraph-go
Go parser for CodeGraph - extracts code entities and relationships from Go source files.
Features
- ✅ Parse Go source files (.go)
- ✅ Extract functions and methods
- ✅ Extract structs and interfaces
- ✅ Track imports
- ✅ Full integration with
codegraph-parser-api
Quick Start
use codegraph::CodeGraph;
use codegraph_parser_api::CodeParser;
use codegraph_go::GoParser;
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut graph = CodeGraph::in_memory()?;
let parser = GoParser::new();
let file_info = parser.parse_file(
Path::new("main.go"),
&mut graph
)?;
println!("Parsed {} functions", file_info.functions.len());
println!("Parsed {} structs", file_info.classes.len());
Ok(())
}
License
Apache-2.0
Dependencies
~33MB
~706K SLoC