NewEncoder returns a new encoder that writes to w.
(w io.Writer)
| 130 | |
| 131 | // NewEncoder returns a new encoder that writes to w. |
| 132 | func NewEncoder(w io.Writer) *Encoder { |
| 133 | e := &Encoder{printer{Writer: bufio.NewWriter(w)}} |
| 134 | e.p.encoder = e |
| 135 | return e |
| 136 | } |
| 137 | |
| 138 | // Indent sets the encoder to generate XML in which each element |
| 139 | // begins on a new indented line that starts with prefix and is followed by |
no outgoing calls