Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
kardolus
GitHub Repository: kardolus/chatgpt-cli
Path: blob/main/vendor/github.com/spf13/viper/internal/encoding/toml/codec.go
2907 views
1
package toml
2
3
import (
4
"github.com/pelletier/go-toml/v2"
5
)
6
7
// Codec implements the encoding.Encoder and encoding.Decoder interfaces for TOML encoding.
8
type Codec struct{}
9
10
func (Codec) Encode(v map[string]any) ([]byte, error) {
11
return toml.Marshal(v)
12
}
13
14
func (Codec) Decode(b []byte, v map[string]any) error {
15
return toml.Unmarshal(b, &v)
16
}
17
18