gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/config.v2/yaml.go (about) 1 package config 2 3 import ( 4 "gitee.com/sy_183/go-common/yaml" 5 "io" 6 ) 7 8 type YamlParser struct{} 9 10 func (p YamlParser) Parse(r io.Reader) (*yaml.Node, error) { 11 node := new(yaml.Node) 12 if err := yaml.NewDecoder(r).Decode(node); err != nil { 13 return nil, err 14 } 15 return node, nil 16 }