spf13--viper/internal/encoding/yaml/codec.go
William Crum ab55d41986
chore: move to sigs.k8s.io/yaml
move to a maintained fork of gopkg.in/yaml.v2 / v3
2025-04-07 17:44:58 -06:00

14 lines
325 B
Go

package yaml
import "sigs.k8s.io/yaml"
// 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)
}