Help us shape the future of Go! Take the 2026 Go Developer Survey

codemap

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentLines

func CommentLines(path string, src []byte) (map[int]bool, error)

CommentLines returns parser-recognized comment locations, excluding strings. Python locations include only standalone comments, never a string prefix on the same line as an unrelated trailing comment. TRLC-LINKS: REQ-EMG-010

func FileID

func FileID(relPath string) string

FileID returns the CODE identifier of a module-relative file path: the path upper-cased with each run of non-alphanumeric characters folded to one hyphen. ENGMODEL-LINKS: FU-CODEMAP-INFERENCE, CTRL-TRACEABILITY-COVERAGE TRLC-LINKS: REQ-EMG-058

Types

type ScanOptions

type ScanOptions struct {
	IDBase string
	Skip   func(path string, isDir bool) bool
}

ScanOptions controls identifier derivation and path filtering for ScanWithOptions. IDBase is the directory symbol identifiers are made relative to (the module root); it defaults to the scan root. Skip, when set, excludes files and directories. ENGMODEL-LINKS: FU-CODEMAP-INFERENCE, CTRL-TRACEABILITY-COVERAGE, DEP-LOCAL-WORKSPACE

type Symbol

type Symbol struct {
	TraceID    string
	PartOf     []string
	Implements []string
	ModelLinks []string
	Path       string
	Line       int
	Signature  string
	// IsTest marks a test entry point the language's runner executes (Go TestX/
	// BenchmarkX/FuzzX/ExampleX in _test.go, Rust #[test]-like functions, Python
	// test* functions in test files). Only these verify the requirements they link.
	IsTest bool
	// TestOnly marks code compiled or collected only for tests: every declaration
	// in a Go _test.go or Python test file and Rust items under #[cfg(test)]. It
	// never counts as production implementation.
	TestOnly bool
}

ENGMODEL-LINKS: FU-CODEMAP-INFERENCE, CTRL-TRACEABILITY-COVERAGE, DEP-LOCAL-WORKSPACE

func Scan

func Scan(root string) ([]Symbol, []validate.Diagnostic, error)

ENGMODEL-LINKS: FU-CODEMAP-INFERENCE, CTRL-TRACEABILITY-COVERAGE, DEP-LOCAL-WORKSPACE TRLC-LINKS: REQ-EMG-010

func ScanWithOptions

func ScanWithOptions(root string, opts ScanOptions) ([]Symbol, []validate.Diagnostic, error)

ENGMODEL-LINKS: FU-CODEMAP-INFERENCE, CTRL-TRACEABILITY-COVERAGE, DEP-LOCAL-WORKSPACE TRLC-LINKS: REQ-EMG-010, REQ-EMG-057, REQ-EMG-058

Jump to

Keyboard shortcuts

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