blob: f94b2699661f1403aaf8611c026d3782e8787f0e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package yaml
import "gopkg.in/yaml.v2"
// Codec implements the encoding.Encoder and encoding.Decoder interfaces for YAML encoding.
type Codec struct{}
func (Codec) Encode(v interface{}) ([]byte, error) {
return yaml.Marshal(v)
}
func (Codec) Decode(b []byte, v interface{}) error {
return yaml.Unmarshal(b, v)
}
|