(e *encodeState, v reflect.Value, opts encOpts)
| 480 | } |
| 481 | |
| 482 | func textMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) { |
| 483 | if v.Kind() == reflect.Ptr && v.IsNil() { |
| 484 | e.WriteString("null") |
| 485 | return |
| 486 | } |
| 487 | m := v.Interface().(encoding.TextMarshaler) |
| 488 | b, err := m.MarshalText() |
| 489 | if err != nil { |
| 490 | e.error(&MarshalerError{v.Type(), err}) |
| 491 | } |
| 492 | e.stringBytes(b, opts.escapeHTML) |
| 493 | } |
| 494 | |
| 495 | func addrTextMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) { |
| 496 | va := v.Addr() |
nothing calls this directly
no test coverage detected