Versions in this module Expand all Collapse all v0 v0.5.7 Dec 5, 2020 Changes in this version + const MaxRelevance + var RequiredGoEnvVars = []string + func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, ...) (formatted []byte, err error) + func GetAllCandidates(ctx context.Context, wrapped func(ImportFix), ...) error + func GetImportPaths(ctx context.Context, wrapped func(ImportFix), ...) error + func GetPackageExports(ctx context.Context, wrapped func(PackageExport), ...) error + func ImportPathToAssumedName(importPath string) string + func PrimeCache(ctx context.Context, env *ProcessEnv) error + func Process(filename string, src []byte, opt *Options) (formatted []byte, err error) + func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map[string]float64, error) + func VendorlessPath(ipath string) string + type ImportFix struct + FixType ImportFixType + IdentName string + Relevance float64 + StmtInfo ImportInfo + func FixImports(filename string, src []byte, opt *Options) (fixes []*ImportFix, err error) + type ImportFixType int + const AddImport + const DeleteImport + const SetImportName + type ImportInfo struct + ImportPath string + Name string + type ModuleResolver struct + func (r *ModuleResolver) ClearForNewMod() + func (r *ModuleResolver) ClearForNewScan() + type Options struct + AllErrors bool + Comments bool + Env *ProcessEnv + FormatOnly bool + Fragment bool + LocalPrefix string + TabIndent bool + TabWidth int + type PackageExport struct + Exports []string + Fix *ImportFix + type ProcessEnv struct + BuildFlags []string + Env map[string]string + GocmdRunner *gocommand.Runner + Logf func(format string, args ...interface{}) + ModFile string + ModFlag string + WorkingDir string + func (e *ProcessEnv) CopyConfig() *ProcessEnv + func (e *ProcessEnv) GetResolver() (Resolver, error) + type Resolver interface + ClearForNewScan func()