You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
419 B

4 years ago
package yaml
import (
"io"
"gitoa.ru/go-4devs/encoding"
"gopkg.in/yaml.v3"
)
4 years ago
var (
_ encoding.Decode = Decode
_ encoding.Encode = Encode
)
4 years ago
// Decode from reader to value.
func Decode(r io.Reader, v interface{}) error {
return yaml.NewDecoder(r).Decode(v)
}
// Encode from value to writer.
func Encode(w io.Writer, v interface{}) error {
enc := yaml.NewEncoder(w)
defer enc.Close()
return enc.Encode(v)
}