...

Source file src/github.com/spf13/viper/internal/encoding/toml/codec.go

Documentation: github.com/spf13/viper/internal/encoding/toml

     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  

View as plain text