golang

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package golang implements import resolution for Go source files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

Resolver resolves Go import paths to repository files using go.mod.

func New

func New(repoRoot string) *Resolver

New creates a new Go resolver for the given repository root. It parses go.mod at the root and optionally go.work for multi-module repos.

func (*Resolver) Resolve

func (r *Resolver) Resolve(srcFile string, fact model.ImportFact, repoRoot string) (model.ResolveResult, error)

Resolve maps a Go import to a single repository file (the first result from ResolveAll).

func (*Resolver) ResolveAll

func (r *Resolver) ResolveAll(srcFile string, fact model.ImportFact, repoRoot string) ([]model.ResolveResult, error)

ResolveAll resolves a Go import to all target files in the package directory. Go imports target directories, not individual files, so a single import can resolve to multiple .go files.

func (*Resolver) ResolveSamePackageEdges

func (r *Resolver) ResolveSamePackageEdges(srcFile, repoRoot string) []model.ResolveResult

ResolveSamePackageEdges returns sibling .go files in the same directory as srcFile. These represent Go's implicit same-package visibility.

Jump to

Keyboard shortcuts

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