Update go dependencies
This commit is contained in:
parent
55ccaf4be3
commit
2882fb5ebe
457 changed files with 54614 additions and 19833 deletions
18
vendor/github.com/onsi/gomega/matchers/receive_matcher.go
generated
vendored
18
vendor/github.com/onsi/gomega/matchers/receive_matcher.go
generated
vendored
|
|
@ -35,11 +35,6 @@ func (matcher *ReceiveMatcher) Match(actual interface{}) (success bool, err erro
|
|||
if argType.Kind() != reflect.Ptr {
|
||||
return false, fmt.Errorf("Cannot assign a value from the channel:\n%s\nTo:\n%s\nYou need to pass a pointer!", format.Object(actual, 1), format.Object(matcher.Arg, 1))
|
||||
}
|
||||
|
||||
assignable := channelType.Elem().AssignableTo(argType.Elem())
|
||||
if !assignable {
|
||||
return false, fmt.Errorf("Cannot assign a value from the channel:\n%s\nTo:\n%s", format.Object(actual, 1), format.Object(matcher.Arg, 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +66,18 @@ func (matcher *ReceiveMatcher) Match(actual interface{}) (success bool, err erro
|
|||
if didReceive {
|
||||
if matcher.Arg != nil {
|
||||
outValue := reflect.ValueOf(matcher.Arg)
|
||||
reflect.Indirect(outValue).Set(value)
|
||||
|
||||
if value.Type().AssignableTo(outValue.Elem().Type()) {
|
||||
outValue.Elem().Set(value)
|
||||
return true, nil
|
||||
}
|
||||
if value.Type().Kind() == reflect.Interface && value.Elem().Type().AssignableTo(outValue.Elem().Type()) {
|
||||
outValue.Elem().Set(value.Elem())
|
||||
return true, nil
|
||||
} else {
|
||||
return false, fmt.Errorf("Cannot assign a value from the channel:\n%s\nType:\n%s\nTo:\n%s", format.Object(actual, 1), format.Object(value.Interface(), 1), format.Object(matcher.Arg, 1))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue