From 1e85ed8060aa6fdecbcb0fd2614c1e8ab5fb12fa Mon Sep 17 00:00:00 2001 From: Suzy Mueller Date: Tue, 2 Jul 2019 14:55:42 -0400 Subject: [PATCH] internal/imports: fix typos in documentation Fix typos and fix descriptions of methods where the behavior described in the comment is not implemented by that method. Change-Id: I2c34caff43399dcb4f0e5e41b67189d8d8404fd5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/184697 TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- internal/imports/fix.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/imports/fix.go b/internal/imports/fix.go index c2e83af6..7cb63369 100644 --- a/internal/imports/fix.go +++ b/internal/imports/fix.go @@ -181,8 +181,8 @@ func collectReferences(f *ast.File) references { return refs } -// collectImports returns all the imports in f, keyed by their package name as -// determined by pathToName. Unnamed imports (., _) and "C" are ignored. +// collectImports returns all the imports in f. +// Unnamed imports (., _) and "C" are ignored. func collectImports(f *ast.File) []*importInfo { var imports []*importInfo for _, imp := range f.Imports { @@ -514,7 +514,7 @@ func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *P return err } -// getFixes gets the getFixes that need to be made to f in order to fix the imports. +// getFixes gets the import fixes that need to be made to f in order to fix the imports. // It does not modify the ast. func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*importFix, error) { abs, err := filepath.Abs(filename) @@ -870,7 +870,7 @@ func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) ( return names, nil } -// importPathToNameGoPath finds out the actual package name, as declared in its .go files. +// importPathToName finds out the actual package name, as declared in its .go files. // If there's a problem, it returns "". func importPathToName(env *ProcessEnv, importPath, srcDir string) (packageName string) { // Fast path for standard library without going to disk. @@ -890,8 +890,8 @@ func importPathToName(env *ProcessEnv, importPath, srcDir string) (packageName s } // packageDirToName is a faster version of build.Import if -// the only thing desired is the package name. It uses build.FindOnly -// to find the directory and then only parses one file in the package, +// the only thing desired is the package name. Given a directory, +// packageDirToName then only parses one file in the package, // trusting that the files in the directory are consistent. func packageDirToName(dir string) (packageName string, err error) { d, err := os.Open(dir)