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:
Issac Trotts
2018-07-27 11:04:34 -07:00
committed by Ross Light
parent d870f380dd
commit 707f33ee6c
2 changed files with 8 additions and 2 deletions

View File

@@ -21,5 +21,6 @@ import (
)
func injectBaz() Baz {
panic(wire.Build(provideBaz))
wire.Build(provideBaz)
return Baz(0)
}

View File

@@ -30,7 +30,12 @@ func NewSet(...interface{}) ProviderSet {
// providers to use. Its arguments are the same as NewSet. Its return
// 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) {
// panic(wire.Build(otherpkg.FooSet, myProviderFunc))