MCPcopy Create free account
hub / github.com/cloudwan/gohan / LoadYAML

Function LoadYAML

extension/gohanscript/util.go:48–54  ·  view source on GitHub ↗

LoadYAML loads YAML from byte buffer

(buf []byte)

Source from the content-addressed store, hash-verified

46
47//LoadYAML loads YAML from byte buffer
48func LoadYAML(buf []byte) (*yaml.Node, error) {
49 node, err := yaml.ParseYAML(buf)
50 if err != nil {
51 return nil, err
52 }
53 return node.Children[0], nil
54}
55
56func convertMapformat(d interface{}) interface{} {
57 switch data := d.(type) {

Callers 2

LoadStringMethod · 0.85
LoadYAMLFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected