MCPcopy
hub / github.com/jmoiron/sqlx / mustBe

Function mustBe

reflectx/reflect.go:246–250  ·  reflectx/reflect.go::mustBe

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)

Source from the content-addressed store, hash-verified

244// mustBe checks a value against a kind, panicing with a reflect.ValueError
245// if the kind isn't that which is required.
246func 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
253func methodName() string {

Callers 5

TestMustBeFunction · 0.85
FieldMapMethod · 0.85
FieldByNameMethod · 0.85
FieldsByNameMethod · 0.85
TraversalsByNameFuncMethod · 0.85

Calls 2

methodNameFunction · 0.85
KindMethod · 0.80

Tested by 1

TestMustBeFunction · 0.68