Encode writes the YAML encoding of v to the stream. If multiple items are encoded to the stream, the second and subsequent document will be preceded with a "---" document separator, but the first will not. See the documentation for Marshal for details about the conversion of Go values to YAML.
(v interface{})
| 247 | // See the documentation for Marshal for details about the conversion of Go |
| 248 | // values to YAML. |
| 249 | func (e *Encoder) Encode(v interface{}) (err error) { |
| 250 | defer handleErr(&err) |
| 251 | e.encoder.marshalDoc("", reflect.ValueOf(v)) |
| 252 | return nil |
| 253 | } |
| 254 | |
| 255 | // Encode encodes value v and stores its representation in n. |
| 256 | // |