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{})
| 83 | // |
| 84 | // See the documentation for Marshal for details about the conversion of Go values to YAML. |
| 85 | func (e *Encoder) Encode(v interface{}) error { |
| 86 | return e.EncodeContext(context.Background(), v) |
| 87 | } |
| 88 | |
| 89 | // EncodeContext writes the YAML encoding of v to the stream with context.Context. |
| 90 | func (e *Encoder) EncodeContext(ctx context.Context, v interface{}) error { |