wire: detect cycles incrementally (google/go-cloud#102)
Idea originally mentioned in google/go-cloud#29. This means that any provider set loaded must not have cycles, which is stricter than before. The cycle error message now gives full detail on what caused the cycle.
This commit is contained in:
@@ -375,6 +375,9 @@ func (oc *objectCache) processNewSet(pkg *loader.PackageInfo, call *ast.CallExpr
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := verifyAcyclic(pset.providerMap, oc.hasher); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return pset, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user