(e *encodeState, v reflect.Value, _ encOpts)
| 463 | } |
| 464 | |
| 465 | func addrMarshalerEncoder(e *encodeState, v reflect.Value, _ encOpts) { |
| 466 | va := v.Addr() |
| 467 | if va.IsNil() { |
| 468 | e.WriteString("null") |
| 469 | return |
| 470 | } |
| 471 | m := va.Interface().(Marshaler) |
| 472 | b, err := m.MarshalJSON() |
| 473 | if err == nil { |
| 474 | // copy JSON into buffer, checking validity. |
| 475 | err = compact(&e.Buffer, b, true) |
| 476 | } |
| 477 | if err != nil { |
| 478 | e.error(&MarshalerError{v.Type(), err}) |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | func textMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) { |
| 483 | if v.Kind() == reflect.Ptr && v.IsNil() { |
nothing calls this directly
no test coverage detected