MCPcopy Index your code
hub / github.com/DataDog/jsonapi / checkMeta

Function checkMeta

jsonapi.go:58–69  ·  view source on GitHub ↗

checkMeta returns a type error if the given meta value is not map-like

(m any)

Source from the content-addressed store, hash-verified

56
57// checkMeta returns a type error if the given meta value is not map-like
58func checkMeta(m any) *TypeError {
59 if m == nil {
60 return nil
61 }
62
63 mt := derefType(reflect.TypeOf(m))
64 if mt.Kind() == reflect.Struct || mt.Kind() == reflect.Map {
65 return nil
66 }
67
68 return &TypeError{Actual: mt.String(), Expected: []string{"struct", "map"}}
69}
70
71// LinkObject is a links object as defined by https://jsonapi.org/format/1.0/#document-links
72type LinkObject struct {

Callers 4

checkLinkValueFunction · 0.85
makeDocumentErrorsFunction · 0.85
makeResourceObjectMethod · 0.85

Calls 2

derefTypeFunction · 0.85
StringMethod · 0.80

Tested by

no test coverage detected