Expand rnode function comments to point to multi-object options.

The rnode Parse and ReadFile functions only return a single object;
suggest kio.ByteReader for the case of parsing multiple objects.
This commit is contained in:
Justin SB
2020-11-15 13:05:27 -05:00
parent b2ba82a0bd
commit a823f3043f

View File

@@ -50,12 +50,14 @@ func GetValue(node *RNode) string {
return node.YNode().Value
}
// Parse parses a yaml string into an *RNode
// Parse parses a yaml string into an *RNode.
// To parse multiple resources, consider a kio.ByteReader
func Parse(value string) (*RNode, error) {
return Parser{Value: value}.Filter(nil)
}
// ReadFile parses a single Resource from a yaml file
// ReadFile parses a single Resource from a yaml file.
// To parse multiple resources, consider a kio.ByteReader
func ReadFile(path string) (*RNode, error) {
b, err := ioutil.ReadFile(path)
if err != nil {