goanalysis

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package goanalysis owns module-aware Go semantic loading for repomap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallEdge

type CallEdge struct {
	CallerFile, CallerSymbol string
	CallerLine               int
	CalleeFile, CalleeSymbol string
	CalleeReceiver           string
}

CallEdge is a source-backed caller to callee relationship from CHA.

type Diagnostic

type Diagnostic struct {
	PackagePath string
	Position    string
	Message     string
}

Diagnostic is a package loader or type-checker diagnostic. Diagnostics do not discard successfully loaded packages.

type Edge

type Edge struct {
	Kind EdgeKind
	From string
	To   string
	File string
	Line int
}

Edge is an internal, qualified semantic relationship.

type EdgeKind

type EdgeKind string

EdgeKind identifies a typed semantic relationship.

const (
	EdgeDefinition     EdgeKind = "definition"
	EdgeReference      EdgeKind = "reference"
	EdgeImport         EdgeKind = "import"
	EdgeCall           EdgeKind = "call"
	EdgeImplementation EdgeKind = "implementation"
	EdgeSelection      EdgeKind = "selection"
)

type File

type File struct {
	Path        string
	PackageName string
	PackagePath string
	Syntax      *ast.File
	FileSet     *token.FileSet
	Types       *types.Package
	TypesInfo   *types.Info
}

File is an active compiled Go file and its package ownership.

type Implementation

type Implementation struct {
	TypeFile      string
	TypeName      string
	InterfacePath string
	InterfaceName string
}

Implementation records a concrete named type satisfying an interface.

type Options

type Options struct {
	Root         string
	Environment  []string
	BuildFlags   []string
	IncludeCalls bool
	IncludeTests bool
}

Options describes the active Go build context used for a repository load.

type Result

type Result struct {
	Files           map[string]File
	Diagnostics     []Diagnostic
	Edges           []Edge
	Calls           []CallEdge
	Implementations []Implementation
}

Result is the canonical semantic graph for one repository load.

func Analyze

func Analyze(ctx context.Context, opts Options) (*Result, error)

Analyze loads and analyzes all packages beneath Root exactly once.

Jump to

Keyboard shortcuts

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