first commit
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
andrey1s
2021-04-26 16:07:41 +03:00
commit d6e6001d6b
18 changed files with 348 additions and 0 deletions

22
toml/encoding.go Normal file
View File

@@ -0,0 +1,22 @@
package toml
import (
"io"
"github.com/BurntSushi/toml"
"gitoa.ru/go-4devs/encoding"
)
var _ encoding.Decode = Decode
var _ encoding.Encode = Encode
// Decode from reader to value.
func Decode(r io.Reader, v interface{}) error {
_, err := toml.DecodeReader(r, v)
return err
}
// Encode from value to writer.
func Encode(w io.Writer, v interface{}) error {
return toml.NewEncoder(w).Encode(v)
}