()
| 98 | } |
| 99 | |
| 100 | func (d *DepDetailGraph) RemoveDedup() { |
| 101 | // map[key] |
| 102 | depSet := map[string]*DepDetailGraph{} |
| 103 | d.ForEach(func(n *DepDetailGraph) bool { |
| 104 | if dep, ok := depSet[n.Key()]; ok { |
| 105 | dep.Paths = append(dep.Paths, n.Paths...) |
| 106 | } else { |
| 107 | depSet[n.Key()] = n |
| 108 | } |
| 109 | return true |
| 110 | }) |
| 111 | d.Children = nil |
| 112 | for _, c := range depSet { |
| 113 | if c != d { |
| 114 | c.Children = nil |
| 115 | d.Children = append(d.Children, c) |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | func (d *DepDetailGraph) RemoveDev() { |
| 121 | d.ForEach(func(n *DepDetailGraph) bool { |
no test coverage detected