(w jsWriter, msg []byte, scratch []byte, depth int)
| 108 | } |
| 109 | |
| 110 | func rwMapBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) { |
| 111 | if depth >= recursionLimit { |
| 112 | return msg, scratch, ErrRecursion |
| 113 | } |
| 114 | sz, msg, err := ReadMapHeaderBytes(msg) |
| 115 | if err != nil { |
| 116 | return msg, scratch, err |
| 117 | } |
| 118 | err = w.WriteByte('{') |
| 119 | if err != nil { |
| 120 | return msg, scratch, err |
| 121 | } |
| 122 | for i := range sz { |
| 123 | if i != 0 { |
| 124 | err = w.WriteByte(',') |
| 125 | if err != nil { |
| 126 | return msg, scratch, err |
| 127 | } |
| 128 | } |
| 129 | msg, scratch, err = rwMapKeyBytes(w, msg, scratch, depth) |
| 130 | if err != nil { |
| 131 | return msg, scratch, err |
| 132 | } |
| 133 | err = w.WriteByte(':') |
| 134 | if err != nil { |
| 135 | return msg, scratch, err |
| 136 | } |
| 137 | msg, scratch, err = writeNext(w, msg, scratch, depth+1) |
| 138 | if err != nil { |
| 139 | return msg, scratch, err |
| 140 | } |
| 141 | } |
| 142 | err = w.WriteByte('}') |
| 143 | return msg, scratch, err |
| 144 | } |
| 145 | |
| 146 | func rwMapKeyBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) { |
| 147 | if len(msg) < 1 { |
nothing calls this directly
no test coverage detected
searching dependent graphs…