MCPcopy
hub / github.com/mitchellh/mapstructure / dereferencePtrToStructIfNeeded

Function dereferencePtrToStructIfNeeded

mapstructure.go:1530–1540  ·  view source on GitHub ↗
(v reflect.Value, tagName string)

Source from the content-addressed store, hash-verified

1528}
1529
1530func dereferencePtrToStructIfNeeded(v reflect.Value, tagName string) reflect.Value {
1531 if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct {
1532 return v
1533 }
1534 deref := v.Elem()
1535 derefT := deref.Type()
1536 if isStructTypeConvertibleToMap(derefT, true, tagName) {
1537 return deref
1538 }
1539 return v
1540}

Callers 1

decodeMapFromStructMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…