summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/viper/internal/encoding/yaml/codec.go
blob: 82dc136a3a1a07b1c8b862578fa6a6257045aebd (plain) (blame)
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]interface{}) ([]byte, error) {
	return yaml.Marshal(v)
}

func (Codec) Decode(b []byte, v map[string]interface{}) error {
	return yaml.Unmarshal(b, &v)
}