golang

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package golang implements the Go source analyzer (package + import + symbol tracking).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoAnalyzer

func GoAnalyzer() *goAnalyzer

GoAnalyzer returns a Go source analyzer (satisfies analyzer.Analyzer and analyzer.BoundaryProvider). Concrete pointer return so tests can call Boundaries without a type assertion; cmd uses the interface upcast.

Types

type ImportKind

type ImportKind int

ImportKind classifies a Go import path by where it resolves.

const (
	ImportStdlib   ImportKind = iota // Go standard library
	ImportInternal                   // package within an analyzed module
	ImportExternal                   // third-party dependency
)

Import kinds classify where a Go import path resolves.

func ClassifyImport

func ClassifyImport(importPath string, modulePaths []string) ImportKind

ClassifyImport returns the kind of a Go import path. modulePaths are the module paths declared by the analyzed source's go.mod files; an import equal to or under one of them is internal. Internal is checked first so a module with a dotless path cannot be mistaken for standard library.

Directories

Path Synopsis
cmd
gen-stdlib command
gen-stdlib runs `go list std` and generates a Go source file containing the set of user-importable standard-library import paths for the current toolchain.
gen-stdlib runs `go list std` and generates a Go source file containing the set of user-importable standard-library import paths for the current toolchain.

Jump to

Keyboard shortcuts

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