docs: update docs with the bind and struct changes (#155)

This commit is contained in:
shantuo
2019-04-23 10:00:57 -07:00
committed by GitHub
parent 63cf8b9f27
commit b1c66a196d
2 changed files with 45 additions and 39 deletions

View File

@@ -29,7 +29,7 @@ func NewGreeter(ctx context.Context, opts *Options) (*Greeter, error) {
// ...
}
var GreeterSet = wire.NewSet(Options{}, NewGreeter)
var GreeterSet = wire.NewSet(wire.Struct(new(Options), "*"), NewGreeter)
```
## Provider Sets in Libraries
@@ -117,5 +117,5 @@ include the mocked types.
Create a new struct that includes the app plus all of the dependencies you want
to mock. Create a test-only injector that returns this struct, give it providers
for the concrete mock types, and use `wire.Bind` to tell Wire that the
concrete mock types should be used to fulfill the appropriate interface.
for the concrete mock types, and use `wire.Bind` to tell Wire that the concrete
mock types should be used to fulfill the appropriate interface.