AppendStringer encodes the input Stringer to json and appends the encoded Stringer value to the input byte slice.
(dst []byte, val fmt.Stringer)
| 82 | // AppendStringer encodes the input Stringer to json and appends the |
| 83 | // encoded Stringer value to the input byte slice. |
| 84 | func (e Encoder) AppendStringer(dst []byte, val fmt.Stringer) []byte { |
| 85 | if val == nil { |
| 86 | return e.AppendInterface(dst, nil) |
| 87 | } |
| 88 | return e.AppendString(dst, val.String()) |
| 89 | } |
| 90 | |
| 91 | // appendStringComplex is used by appendString to take over an in |
| 92 | // progress JSON string encoding that encountered a character that needs |