Skip to content

Commit

Permalink
Merge branch 'main' into aaronc/fix-container-module-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored May 9, 2022
2 parents 68600fc + 10af6f9 commit 322fca9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ func (c *container) addNode(provider *ProviderDescriptor, key *moduleKey) (inter
}

vr = &simpleResolver{
node: sp,
typ: typ,
graphNode: typeGraphNode,
node: sp,
typ: typ,
graphNode: typeGraphNode,
idxInValues: i,
}
c.resolvers[typ] = vr
}
Expand Down
6 changes: 4 additions & 2 deletions container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ type TestOutput struct {
container.Out

X string
Y int64
}

func TestStructArgs(t *testing.T) {
Expand All @@ -478,11 +479,12 @@ func TestStructArgs(t *testing.T) {
))

require.NoError(t, container.Run(
func(x string) {
func(x string, y int64) {
require.Equal(t, "A", x)
require.Equal(t, int64(-10), y)
},
container.Provide(func() (TestOutput, error) {
return TestOutput{X: "A"}, nil
return TestOutput{X: "A", Y: -10}, nil
}),
))

Expand Down

0 comments on commit 322fca9

Please sign in to comment.