1package toml 2 3import ( 4 "github.com/pelletier/go-toml/v2" 5) 6 7// Codec implements the encoding.Encoder and encoding.Decoder interfaces for TOML encoding. 8type Codec struct{} 9 10func (Codec) Encode(v map[string]any) ([]byte, error) { 11 return toml.Marshal(v) 12} 13 14func (Codec) Decode(b []byte, v map[string]any) error { 15 return toml.Unmarshal(b, &v) 16} 17 18