|
|
@ -56,26 +56,27 @@ func GetImports(absPath, importPath string, example bool) []string { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//fis := GetDirsInfo(absPath)
|
|
|
|
fis := GetDirsInfo(absPath) |
|
|
|
absPath += "/" |
|
|
|
absPath += "/" |
|
|
|
|
|
|
|
|
|
|
|
// Load too much, skip for now.
|
|
|
|
|
|
|
|
// dirs := make([]string, 0)
|
|
|
|
|
|
|
|
// for _, fi := range fis {
|
|
|
|
|
|
|
|
// if fi.IsDir() && !strings.Contains(fi.Name(), VENDOR) {
|
|
|
|
|
|
|
|
// dirs = append(dirs, absPath+fi.Name())
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
imports := make([]string, 0, len(pkg.Imports)) |
|
|
|
imports := make([]string, 0, len(pkg.Imports)) |
|
|
|
for _, p := range pkg.Imports { |
|
|
|
for _, p := range pkg.Imports { |
|
|
|
if !IsGoRepoPath(p) && !strings.HasPrefix(p, importPath) { |
|
|
|
if !IsGoRepoPath(p) && !strings.HasPrefix(p, importPath) { |
|
|
|
imports = append(imports, p) |
|
|
|
imports = append(imports, p) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// if len(dirs) > 0 {
|
|
|
|
|
|
|
|
// imports = append(imports, GetAllImports(dirs, importPath, example)...)
|
|
|
|
// TODO: Load too much
|
|
|
|
// }
|
|
|
|
dirs := make([]string, 0, len(imports)) |
|
|
|
|
|
|
|
for _, fi := range fis { |
|
|
|
|
|
|
|
if fi.IsDir() && !strings.Contains(fi.Name(), VENDOR) { |
|
|
|
|
|
|
|
dirs = append(dirs, absPath+fi.Name()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(dirs) > 0 { |
|
|
|
|
|
|
|
imports = append(imports, GetAllImports(dirs, importPath, example)...) |
|
|
|
|
|
|
|
} |
|
|
|
return imports |
|
|
|
return imports |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|