MCPcopy Create free account
hub / github.com/blues/note / addrTextMarshalerEncoder

Function addrTextMarshalerEncoder

jsonxt/encode.go:495–507  ·  view source on GitHub ↗
(e *encodeState, v reflect.Value, opts encOpts)

Source from the content-addressed store, hash-verified

493}
494
495func addrTextMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) {
496 va := v.Addr()
497 if va.IsNil() {
498 e.WriteString("null")
499 return
500 }
501 m := va.Interface().(encoding.TextMarshaler)
502 b, err := m.MarshalText()
503 if err != nil {
504 e.error(&MarshalerError{v.Type(), err})
505 }
506 e.stringBytes(b, opts.escapeHTML)
507}
508
509func boolEncoder(e *encodeState, v reflect.Value, opts encOpts) {
510 if opts.quoted {

Callers

nothing calls this directly

Calls 2

stringBytesMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected