MCPcopy Create free account
hub / github.com/DataDog/jsonapi / setFieldValue

Function setFieldValue

reflect.go:40–49  ·  view source on GitHub ↗
(fv reflect.Value, v any)

Source from the content-addressed store, hash-verified

38}
39
40func setFieldValue(fv reflect.Value, v any) {
41 vv := reflect.ValueOf(v)
42
43 // if the field is not a pointer, dereference the value fully in case
44 // it is a pointer (likely returned by reflect.New)
45 if fv.Kind() != reflect.Pointer {
46 vv = derefValue(vv)
47 }
48 fv.Set(vv)
49}
50
51func canBeNil(fv reflect.Value) bool {
52 return fv.Kind() == reflect.Interface ||

Callers 1

unmarshalFieldsMethod · 0.85

Calls 1

derefValueFunction · 0.85

Tested by

no test coverage detected