X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=blobdiff_plain;f=targets.go;h=0545483752bda04c4ac1347cb16421ee46215c98;hp=bc8edfd6d0b00669f1d48a8491034ddef151bda0;hb=ca5290c19761bc1806b98d54d966a9cbbfeabd15;hpb=009b34e1c2f6bfe89b33d96697879b33d9b901dc diff --git a/targets.go b/targets.go index bc8edfd..0545483 100644 --- a/targets.go +++ b/targets.go @@ -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) + } +}