Kyaml api cleanup

This commit is contained in:
jregan
2020-08-07 11:49:20 -07:00
parent 4b4049e646
commit cf5b26db8a
2 changed files with 26 additions and 17 deletions

View File

@@ -176,12 +176,6 @@ func (r *ByteReader) Read() ([]*yaml.RNode, error) {
return output, nil
}
func isEmptyDocument(node *yaml.Node) bool {
// node is a Document with no content -- e.g. "---\n---"
return node.Kind == yaml.DocumentNode &&
node.Content[0].Tag == yaml.NodeTagNull
}
func (r *ByteReader) decode(index int, decoder *yaml.Decoder) (*yaml.RNode, error) {
node := &yaml.Node{}
err := decoder.Decode(node)
@@ -192,7 +186,7 @@ func (r *ByteReader) decode(index int, decoder *yaml.Decoder) (*yaml.RNode, erro
return nil, errors.Wrap(err)
}
if isEmptyDocument(node) {
if yaml.IsYNodeEmptyDoc(node) {
return nil, nil
}