mustBe checks a value against a kind, panicing with a reflect.ValueError if the kind isn't that which is required.
(v kinder, expected reflect.Kind)
| 244 | // mustBe checks a value against a kind, panicing with a reflect.ValueError |
| 245 | // if the kind isn't that which is required. |
| 246 | func mustBe(v kinder, expected reflect.Kind) { |
| 247 | if k := v.Kind(); k != expected { |
| 248 | panic(&reflect.ValueError{Method: methodName(), Kind: k}) |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | // methodName returns the caller of the function calling methodName |
| 253 | func methodName() string { |