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 <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
parent
5a5cfefe1f
commit
1e85ed8060
|
@ -181,8 +181,8 @@ func collectReferences(f *ast.File) references {
|
||||||
return refs
|
return refs
|
||||||
}
|
}
|
||||||
|
|
||||||
// collectImports returns all the imports in f, keyed by their package name as
|
// collectImports returns all the imports in f.
|
||||||
// determined by pathToName. Unnamed imports (., _) and "C" are ignored.
|
// Unnamed imports (., _) and "C" are ignored.
|
||||||
func collectImports(f *ast.File) []*importInfo {
|
func collectImports(f *ast.File) []*importInfo {
|
||||||
var imports []*importInfo
|
var imports []*importInfo
|
||||||
for _, imp := range f.Imports {
|
for _, imp := range f.Imports {
|
||||||
|
@ -514,7 +514,7 @@ func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *P
|
||||||
return err
|
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.
|
// It does not modify the ast.
|
||||||
func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*importFix, error) {
|
func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*importFix, error) {
|
||||||
abs, err := filepath.Abs(filename)
|
abs, err := filepath.Abs(filename)
|
||||||
|
@ -870,7 +870,7 @@ func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (
|
||||||
return names, nil
|
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 "".
|
// If there's a problem, it returns "".
|
||||||
func importPathToName(env *ProcessEnv, importPath, srcDir string) (packageName string) {
|
func importPathToName(env *ProcessEnv, importPath, srcDir string) (packageName string) {
|
||||||
// Fast path for standard library without going to disk.
|
// 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
|
// packageDirToName is a faster version of build.Import if
|
||||||
// the only thing desired is the package name. It uses build.FindOnly
|
// the only thing desired is the package name. Given a directory,
|
||||||
// to find the directory and then only parses one file in the package,
|
// packageDirToName then only parses one file in the package,
|
||||||
// trusting that the files in the directory are consistent.
|
// trusting that the files in the directory are consistent.
|
||||||
func packageDirToName(dir string) (packageName string, err error) {
|
func packageDirToName(dir string) (packageName string, err error) {
|
||||||
d, err := os.Open(dir)
|
d, err := os.Open(dir)
|
||||||
|
|
Loading…
Reference in New Issue