()
| 88 | } |
| 89 | |
| 90 | func (e *Encoder) Flush() error { |
| 91 | if e.Err != nil { |
| 92 | return errors.Trace(ErrFailedEncoder) |
| 93 | } |
| 94 | if err := e.bw.Flush(); err != nil { |
| 95 | e.Err = errors.Trace(err) |
| 96 | } |
| 97 | return e.Err |
| 98 | } |
| 99 | |
| 100 | func Encode(w io.Writer, r *Resp) error { |
| 101 | return NewEncoder(w).Encode(r, true) |
no outgoing calls