wire: give wire.Bind access to the arguments to the injector function (google/go-cloud#715)

This commit is contained in:
Robert van Gent
2018-11-16 10:26:10 -08:00
committed by Ross Light
parent 67170e739d
commit 6ea381b3fe
11 changed files with 173 additions and 89 deletions

View File

@@ -238,6 +238,9 @@ func gather(info *wire.Info, key wire.ProviderSetID) (_ []outGroup, imports map[
case pv.IsNil():
// This is an input.
inputVisited.Set(curr, -1)
case pv.IsArg():
// This is an injector argument.
inputVisited.Set(curr, -1)
case pv.IsProvider():
// Try to see if any args haven't been visited.
p := pv.Provider()