MCPcopy
hub / github.com/TomWright/dasel / dencodingMapValue

Method dencodingMapValue

model/value_map.go:29–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (v *Value) dencodingMapValue() (*orderedmap.Map, error) {
30 if v.isDencodingMap() {
31 m, err := v.UnpackUntilType(reflect.TypeFor[*orderedmap.Map]())
32 if err != nil {
33 return nil, fmt.Errorf("error getting map: %w", err)
34 }
35 return m.value.Interface().(*orderedmap.Map), nil
36 }
37 return nil, fmt.Errorf("value is not a dencoding map")
38}
39
40// SetMapKey sets the value at the specified key in the map.
41func (v *Value) SetMapKey(key string, value *Value) error {

Callers 4

SetMapKeyMethod · 0.95
GetMapKeyMethod · 0.95
DeleteMapKeyMethod · 0.95
MapKeysMethod · 0.95

Calls 3

isDencodingMapMethod · 0.95
UnpackUntilTypeMethod · 0.95
InterfaceMethod · 0.80

Tested by

no test coverage detected