1
0
Bifurcation 0

report as we find them

this is in prep to make process concurrent
Cette révision appartient à :
Stephen McQuay 2017-02-09 08:31:37 -08:00
Parent 34740782b6
révision 34cdece6ae
Signature inconnue de Gitea
ID de la clé GPG: 1ABF428F71BAFC3D
1 fichiers modifiés avec 4 ajouts et 12 suppressions

16
main.go
Voir le fichier

@ -44,7 +44,7 @@ func main() {
}
}
execs := map[string][]string{}
execs := map[string]bool{}
execNames := []string{}
buf := &bytes.Buffer{}
for _, name := range files {
@ -80,7 +80,7 @@ func main() {
if bytes.Equal(buf.Bytes(), b) {
_, en := filepath.Split(name)
if _, ok := execs[en]; !ok {
execs[en] = []string{}
execs[en] = true
execNames = append(execNames, en)
}
}
@ -108,22 +108,14 @@ func main() {
return nil
}
_, en := filepath.Split(pkg.ImportPath)
p := filepath.Join(srcDir, pkg.ImportPath)
if _, ok := execs[en]; ok {
execs[en] = append(execs[en], filepath.Join(srcDir, pkg.ImportPath))
fmt.Printf("%-30s%s\n", en, p)
}
return nil
},
)
}
for _, name := range execNames {
if len(execs[name]) > 0 {
fmt.Println(name)
for _, potential := range execs[name] {
fmt.Printf("\t%s\n", potential)
}
}
}
}
// Exists emits true if path exists, false otherwise