wire: add a test for using a function argument as a provider (google/go-cloud#724)
This commit is contained in:
committed by
Ross Light
parent
6ea381b3fe
commit
925a11ad0d
@@ -455,7 +455,7 @@ func (oc *objectCache) get(obj types.Object) (val interface{}, errs []error) {
|
||||
switch obj := obj.(type) {
|
||||
case *types.Var:
|
||||
spec := oc.varDecl(obj)
|
||||
if len(spec.Values) == 0 {
|
||||
if spec == nil || len(spec.Values) == 0 {
|
||||
return nil, []error{fmt.Errorf("%v is not a provider or a provider set", obj)}
|
||||
}
|
||||
var i int
|
||||
|
||||
Reference in New Issue
Block a user