all: replace more panic(wire.Build(...)) calls with wire.Build(...); return stuff (google/go-cloud#248)
Fixes google/go-cloud#246
This commit is contained in:
@@ -21,5 +21,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func injectBaz() Baz {
|
func injectBaz() Baz {
|
||||||
panic(wire.Build(provideBaz))
|
wire.Build(provideBaz)
|
||||||
|
return Baz(0)
|
||||||
}
|
}
|
||||||
|
|||||||
7
wire.go
7
wire.go
@@ -30,7 +30,12 @@ func NewSet(...interface{}) ProviderSet {
|
|||||||
// providers to use. Its arguments are the same as NewSet. Its return
|
// providers to use. Its arguments are the same as NewSet. Its return
|
||||||
// value is an error message that can be sent to panic.
|
// value is an error message that can be sent to panic.
|
||||||
//
|
//
|
||||||
// Example:
|
// Examples:
|
||||||
|
//
|
||||||
|
// func injector(ctx context.Context) (*sql.DB, error) {
|
||||||
|
// wire.Build(otherpkg.FooSet, myProviderFunc)
|
||||||
|
// return nil, nil
|
||||||
|
// }
|
||||||
//
|
//
|
||||||
// func injector(ctx context.Context) (*sql.DB, error) {
|
// func injector(ctx context.Context) (*sql.DB, error) {
|
||||||
// panic(wire.Build(otherpkg.FooSet, myProviderFunc))
|
// panic(wire.Build(otherpkg.FooSet, myProviderFunc))
|
||||||
|
|||||||
Reference in New Issue
Block a user