Browse Source

report as we find them

this is in prep to make process concurrent
master
Stephen McQuay 3 years ago
parent
commit
34cdece6ae
No known key found for this signature in database GPG Key ID: 1ABF428F71BAFC3D
1 changed files with 4 additions and 12 deletions
  1. +4
    -12
      main.go

+ 4
- 12
main.go View File

@@ -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


Loading…
Cancel
Save