golang

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package golang implements the Go language extractor.

The package is named `golang` (not `go`) to avoid the keyword collision in Go import paths — matches the smacker/go-tree-sitter/golang convention.

Mirrors src/main/java/.../intelligence/extractor/go/GoLanguageExtractor.java but trimmed to the per-task brief:

  • METHOD nodes: emit CALLS edges for call_expression children of the matching function_declaration / method_declaration. Qualified callees (`pkg.Func`) strip to the bare name before lookup so cross-package calls resolve to METHOD nodes that registry-keyed by simple label.
  • CLASS nodes: scan for `var _ Iface = (*Foo)(nil)` style interface assertions and stamp `implements_types` with the interface qualifier literal text.

Confidence: PARTIAL — Go's structural typing isn't resolved here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct{}

Extractor implements LanguageExtractor for Go. Stateless.

func New

func New() *Extractor

New returns a Go extractor.

func (*Extractor) Extract

func (e *Extractor) Extract(ctx extractor.Context, node *model.CodeNode) extractor.Result

Extract dispatches by node kind. Single-node convenience wrapper — production paths use ExtractFromTree.

func (*Extractor) ExtractFromTree

func (e *Extractor) ExtractFromTree(ctx extractor.Context, tree *parser.Tree, nodes []*model.CodeNode) []extractor.Result

ExtractFromTree walks the pre-parsed tree once per input node, returning one Result per node in matching order. tree may be nil — every result is EmptyResult in that case.

func (*Extractor) Language

func (e *Extractor) Language() string

Language returns "go".

Jump to

Keyboard shortcuts

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