isPubSub tests whether the given method has as as first argument a context.Context and returns the pair (Subscription, error)
(methodType reflect.Type)
| 85 | // isPubSub tests whether the given method has as as first argument a context.Context |
| 86 | // and returns the pair (Subscription, error) |
| 87 | func isPubSub(methodType reflect.Type) bool { |
| 88 | // numIn(0) is the receiver type |
| 89 | if methodType.NumIn() < 2 || methodType.NumOut() != 2 { |
| 90 | return false |
| 91 | } |
| 92 | |
| 93 | return isContextType(methodType.In(1)) && |
| 94 | isSubscriptionType(methodType.Out(0)) && |
| 95 | isErrorType(methodType.Out(1)) |
| 96 | } |
| 97 | |
| 98 | // formatName will convert to first character to lower case |
| 99 | func formatName(name string) string { |
no test coverage detected