mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 05:38:04 +00:00
a9c3617b4f
* Decoder Properties * Added properties round trip test * Fixed property decode for github actions * Refactored XML test to use common functions * Switched formatScenario parameter order for more readablity
24 lines
367 B
Go
24 lines
367 B
Go
package yqlib
|
|
|
|
import (
|
|
"io"
|
|
|
|
yaml "gopkg.in/yaml.v3"
|
|
)
|
|
|
|
type yamlDecoder struct {
|
|
decoder yaml.Decoder
|
|
}
|
|
|
|
func NewYamlDecoder() Decoder {
|
|
return &yamlDecoder{}
|
|
}
|
|
|
|
func (dec *yamlDecoder) Init(reader io.Reader) {
|
|
dec.decoder = *yaml.NewDecoder(reader)
|
|
}
|
|
|
|
func (dec *yamlDecoder) Decode(rootYamlNode *yaml.Node) error {
|
|
return dec.decoder.Decode(rootYamlNode)
|
|
}
|