cmd/wire: simplify gather append (#248)

This commit is contained in:
Jason Song
2020-05-04 23:36:46 +08:00
committed by GitHub
parent fda113507a
commit ff891bb6d8

View File

@@ -399,9 +399,7 @@ func gather(info *wire.Info, key wire.ProviderSetID) (_ []outGroup, imports map[
if curr.VarName != "" && !(curr.PkgPath == key.ImportPath && curr.VarName == key.VarName) { if curr.VarName != "" && !(curr.PkgPath == key.ImportPath && curr.VarName == key.VarName) {
imports[formatProviderSetName(curr.PkgPath, curr.VarName)] = struct{}{} imports[formatProviderSetName(curr.PkgPath, curr.VarName)] = struct{}{}
} }
for _, imp := range curr.Imports { next = append(next, curr.Imports...)
next = append(next, imp)
}
} }
// Depth-first search to build groups. // Depth-first search to build groups.