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

dependencies

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

Analyzer analyzes package dependencies

func NewAnalyzer

func NewAnalyzer(projectPath string) (*Analyzer, error)

NewAnalyzer creates a new dependency analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(files []*parser.FileMetrics) ([]*PackageDependencies, error)

Analyze analyzes dependencies across all files

func (*Analyzer) DetectCircularDependencies

func (a *Analyzer) DetectCircularDependencies(files []*parser.FileMetrics) ([]*CircularDependency, error)

DetectCircularDependencies finds circular dependencies using DFS

type CircularDependency

type CircularDependency struct {
	Cycle []string `json:"cycle"` // The circular dependency chain
}

CircularDependency represents a circular dependency between packages

func (*CircularDependency) FormatCycle

func (cd *CircularDependency) FormatCycle() string

FormatCycle returns a human-readable representation of a circular dependency

type PackageDependencies

type PackageDependencies struct {
	PackageName         string   `json:"package_name"`
	StdlibImports       []string `json:"stdlib_imports"`
	InternalImports     []string `json:"internal_imports"`
	ExternalImports     []string `json:"external_imports"`
	TotalImports        int      `json:"total_imports"`
	ExternalImportCount int      `json:"external_import_count"`
}

PackageDependencies represents dependency information for a single package

Jump to

Keyboard shortcuts

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