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

Function baseType

sqlx.go:1012–1018  ·  view source on GitHub ↗

reflect helpers

(t reflect.Type, expected reflect.Kind)

Source from the content-addressed store, hash-verified

1010// reflect helpers
1011
1012func baseType(t reflect.Type, expected reflect.Kind) (reflect.Type, error) {
1013 t = reflectx.Deref(t)
1014 if t.Kind() != expected {
1015 return nil, fmt.Errorf("expected %s but got %s", expected, t.Kind())
1016 }
1017 return t, nil
1018}
1019
1020// fieldsByName fills a values interface with fields from the passed value based
1021// on the traversals in int. If ptrs is true, return addresses instead of values.

Callers 1

scanAllFunction · 0.85

Calls 3

DerefFunction · 0.92
KindMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected