Browse Source

report as we find them

this is in prep to make process concurrent
Stephen McQuay 2 years ago
parent
commit
34cdece6ae
No known key found for this signature in database
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() {
44 44
 		}
45 45
 	}
46 46
 
47
-	execs := map[string][]string{}
47
+	execs := map[string]bool{}
48 48
 	execNames := []string{}
49 49
 	buf := &bytes.Buffer{}
50 50
 	for _, name := range files {
@@ -80,7 +80,7 @@ func main() {
80 80
 			if bytes.Equal(buf.Bytes(), b) {
81 81
 				_, en := filepath.Split(name)
82 82
 				if _, ok := execs[en]; !ok {
83
-					execs[en] = []string{}
83
+					execs[en] = true
84 84
 					execNames = append(execNames, en)
85 85
 				}
86 86
 			}
@@ -108,22 +108,14 @@ func main() {
108 108
 					return nil
109 109
 				}
110 110
 				_, en := filepath.Split(pkg.ImportPath)
111
+				p := filepath.Join(srcDir, pkg.ImportPath)
111 112
 				if _, ok := execs[en]; ok {
112
-					execs[en] = append(execs[en], filepath.Join(srcDir, pkg.ImportPath))
113
+					fmt.Printf("%-30s%s\n", en, p)
113 114
 				}
114 115
 				return nil
115 116
 			},
116 117
 		)
117 118
 	}
118
-
119
-	for _, name := range execNames {
120
-		if len(execs[name]) > 0 {
121
-			fmt.Println(name)
122
-			for _, potential := range execs[name] {
123
-				fmt.Printf("\t%s\n", potential)
124
-			}
125
-		}
126
-	}
127 119
 }
128 120
 
129 121
 // Exists emits true if path exists, false otherwise

Loading…
Cancel
Save