()
| 229 | } |
| 230 | |
| 231 | func (e *StructEncoder) optInstrRaw() { |
| 232 | conv := func(v unsafe.Pointer, w *Buffer) { |
| 233 | s := *(*string)(v) |
| 234 | if len(s) == 0 { |
| 235 | w.Write(null) |
| 236 | return |
| 237 | } |
| 238 | w.WriteString(s) |
| 239 | } |
| 240 | |
| 241 | if e.f.Type.Kind() == reflect.Ptr { |
| 242 | e.ptrval(conv) |
| 243 | } else { |
| 244 | e.val(conv) |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | func (e *StructEncoder) optInstrEscape() { |
| 249 | if e.f.Type.Kind() == reflect.Slice { |
no test coverage detected