MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / encodeMapStringBoolValue

Function encodeMapStringBoolValue

encode_map.go:33–57  ·  view source on GitHub ↗
(e *Encoder, v reflect.Value)

Source from the content-addressed store, hash-verified

31}
32
33func encodeMapStringBoolValue(e *Encoder, v reflect.Value) error {
34 if v.IsNil() {
35 return e.EncodeNil()
36 }
37
38 if err := e.EncodeMapLen(v.Len()); err != nil {
39 return err
40 }
41
42 m := v.Convert(mapStringBoolType).Interface().(map[string]bool)
43 if e.flags&sortMapKeysFlag != 0 {
44 return e.encodeSortedMapStringBool(m)
45 }
46
47 for mk, mv := range m {
48 if err := e.EncodeString(mk); err != nil {
49 return err
50 }
51 if err := e.EncodeBool(mv); err != nil {
52 return err
53 }
54 }
55
56 return nil
57}
58
59func encodeMapStringStringValue(e *Encoder, v reflect.Value) error {
60 if v.IsNil() {

Callers

nothing calls this directly

Calls 5

EncodeNilMethod · 0.80
EncodeMapLenMethod · 0.80
EncodeStringMethod · 0.80
EncodeBoolMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…