]> Cypherpunks.ru repositories - goredo.git/blobdiff - targets.go
redo-affects
[goredo.git] / targets.go
index bc8edfd6d0b00669f1d48a8491034ddef151bda0..0545483752bda04c4ac1347cb16421ee46215c98 100644 (file)
@@ -76,7 +76,7 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
 }
 
 func targetsWalker(tgts []string) ([]string, error) {
-       tgtsMap := make(map[string]struct{}, 0)
+       tgtsMap := map[string]struct{}{}
        for _, tgt := range tgts {
                if err := targetsCollect(tgt, tgtsMap); err != nil {
                        return nil, err
@@ -88,3 +88,14 @@ func targetsWalker(tgts []string) ([]string, error) {
        }
        return tgts, nil
 }
+
+func collectWholeDeps(
+       tgts map[string]struct{},
+       deps map[string]map[string]struct{},
+       seen map[string]struct{},
+) {
+       for tgt := range tgts {
+               seen[tgt] = struct{}{}
+               collectWholeDeps(deps[tgt], deps, seen)
+       }
+}