package
0.31.0
Repository: https://go.googlesource.com/tools
Documentation: pkg.go.dev

# Functions

ApplyFixes applies all of the fixes to the file and formats it.
CanUse reports whether the package in dir is usable from filename, respecting the Go "internal" and "vendor" visibility rules.
FixImports returns a list of fixes to the imports that, when applied, will leave the imports in the same state as Process.
GetAllCandidates calls wrapped for each package whose name starts with searchPrefix, and can be imported from filename with the package name filePkg.
GetImportPaths calls wrapped for each package whose import path starts with searchPrefix, and can be imported from filename with the package name filePkg.
GetPackageExports returns all known packages with name pkg and their exports.
ImportPathToAssumedName returns the assumed package name of an import path.
No description provided by the author
create a new Source.
NewProcessEnvSource returns a [ProcessEnvSource] wrapping the given env, to be used for fixing imports in the file with name filename in package named pkgName.
No description provided by the author
Process implements golang.org/x/tools/imports.Process with explicit context in opt.Env.
ScanModuleCache walks the given directory, which must be a GOMODCACHE value, for directory package information, storing the results in cache.
No description provided by the author
VendorlessPath returns the devendorized version of the import path ipath.

# Constants

No description provided by the author
No description provided by the author
MaxRelevance is the highest relevance, used for the standard library.
No description provided by the author

# Structs

DirInfoCache is a concurrency-safe map for storing information about directories that may contain packages.
No description provided by the author
An ImportInfo represents a single import statement.
implements Source using modindex, so only for module cache.
ModuleResolver implements the Resolver interface for a workspace using modules.
Options is golang.org/x/tools/imports.Options with extra internal-only options.
A PackageExport is a package and its exports.
A PackageInfo represents what's known about a package.
ProcessEnv contains environment variables and settings that affect the use of the go command, the go/build package, etc.
ProcessEnvSource implements the [Source] interface using the legacy [ProcessEnv] abstraction.
A Result satisfies a missing import.

# Interfaces

A Resolver does the build-system-specific parts of goimports.
A Source provides imports to satisfy unresolved references in the file being fixed.

# Type aliases

No description provided by the author
These types document the APIs below.
These types document the APIs below.
These types document the APIs below.
These types document the APIs below.