gotools/internal/imports/sortimports.go

// sortImports sorts runs of consecutive import lines in import blocks in f.
// It also removes duplicate imports when it is possible to do so without data loss.
//
// It may mutate the token.File and the ast.File.
func sortImports(localPrefix string, tokFile *token.File, f *ast.File) {}

// mergeImports merges all the import declarations into the first one.
// Taken from golang.org/x/tools/ast/astutil.
// This does not adjust line numbers properly
func mergeImports(f *ast.File) {}

// declImports reports whether gen contains an import of path.
// Taken from golang.org/x/tools/ast/astutil.
func declImports(gen *ast.GenDecl, path string) bool {}

func importPath(s ast.Spec) string {}

func importName(s ast.Spec) string {}

func importComment(s ast.Spec) string {}

// collapse indicates whether prev may be removed, leaving only next.
func collapse(prev, next ast.Spec) bool {}

type posSpan

// sortSpecs sorts the import specs within each import decl.
// It may mutate the token.File.
func sortSpecs(localPrefix string, tokFile *token.File, f *ast.File, specs []ast.Spec) []ast.Spec {}

type byImportSpec

func (x byImportSpec) Len() int      {}

func (x byImportSpec) Swap(i, j int) {}

func (x byImportSpec) Less(i, j int) bool {}

type byCommentPos

func (x byCommentPos) Len() int           {}

func (x byCommentPos) Swap(i, j int)      {}

func (x byCommentPos) Less(i, j int) bool {}