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