fix golint issues in core/mapping (#497)

This commit is contained in:
Kevin Wan
2021-02-20 23:18:22 +08:00
committed by GitHub
parent 226513ed60
commit 334ee4213f
8 changed files with 87 additions and 67 deletions

View File

@@ -13,15 +13,18 @@ import (
const yamlTagKey = "json"
var (
// ErrUnsupportedType is an error that indicates the config format is not supported.
ErrUnsupportedType = errors.New("only map-like configs are suported")
yamlUnmarshaler = NewUnmarshaler(yamlTagKey)
)
// UnmarshalYamlBytes unmarshals content into v.
func UnmarshalYamlBytes(content []byte, v interface{}) error {
return unmarshalYamlBytes(content, v, yamlUnmarshaler)
}
// UnmarshalYamlReader unmarshals content from reader into v.
func UnmarshalYamlReader(reader io.Reader, v interface{}) error {
return unmarshalYamlReader(reader, v, yamlUnmarshaler)
}