parsers.go
Go regex-based parser. Extracts functions, types, structs, methods, and interfaces from Go source files.
Classes
class
class GoParser(BaseParser)
Regex-based parser for Go source files.
Methods
def
def parse_file(self, filepath: str | Path) -> ModuleDoc | None
Parse a Go source file and return a ModuleDoc.
def
def _extract_methods(self, source: str, struct_name: str) -> list[FunctionDoc]
Find all methods with a receiver of the given struct type.
Functions
def
def _build_godoc_map(source: str) -> dict[int, str]
Map declaration positions to their preceding godoc comments.
def
def _clean_godoc(raw: str) -> str
Clean Go doc comment lines.
def
def _parse_go_params(raw: str) -> list[ArgInfo]
Parse Go function parameters.