golang

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package golang parses Go source via the stdlib go/parser+go/ast. This is the same idiom CKG uses — for Go specifically, stdlib is more accurate than tree-sitter (full type information available; resolves generics; canonical line/column numbers via go/token).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct{}

Parser is the Go-language SymbolSpan extractor.

func New

func New() *Parser

New constructs a stateless parser. Parsers are cheap; instantiating one per file is fine.

func (*Parser) Language

func (p *Parser) Language() string

func (*Parser) Parse

func (p *Parser) Parse(file string, src []byte) ([]cparse.SymbolSpan, error)

Parse extracts top-level func/method/type declarations. Nested closures inside functions are NOT lifted — they ride along with the enclosing function's chunk, which is the right granularity for retrieval (a closure rarely makes sense on its own).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL