changeset 265 | 05c40b36d3b2 |
parent 264 | 8f478162d991 |
child 266 | 80973a656b81 |
264:8f478162d991 | 265:05c40b36d3b2 |
---|---|
1 //go:build !viper_toml1 |
|
2 // +build !viper_toml1 |
|
3 |
|
4 package toml |
|
5 |
|
6 import ( |
|
7 "github.com/pelletier/go-toml/v2" |
|
8 ) |
|
9 |
|
10 // Codec implements the encoding.Encoder and encoding.Decoder interfaces for TOML encoding. |
|
11 type Codec struct{} |
|
12 |
|
13 func (Codec) Encode(v map[string]interface{}) ([]byte, error) { |
|
14 return toml.Marshal(v) |
|
15 } |
|
16 |
|
17 func (Codec) Decode(b []byte, v map[string]interface{}) error { |
|
18 return toml.Unmarshal(b, &v) |
|
19 } |