MCPcopy Create free account
hub / github.com/cel-expr/cel-go / sourceToYAML

Function sourceToYAML

policy/parser.go:566–575  ·  view source on GitHub ↗
(src *Source, docNode *yaml.Node)

Source from the content-addressed store, hash-verified

564}
565
566func sourceToYAML(src *Source, docNode *yaml.Node) error {
567 err := yaml.Unmarshal([]byte(src.Content()), docNode)
568 if err != nil {
569 return err
570 }
571 if docNode.Kind != yaml.DocumentNode {
572 return fmt.Errorf("got yaml node of kind %v, wanted mapping node", docNode.Kind)
573 }
574 return nil
575}
576
577func newParserImpl(visitor TagVisitor, info *ast.SourceInfo, src *Source, iss *cel.Issues, arrayStyleVariables bool) *parserImpl {
578 return &parserImpl{

Callers 1

parseYAMLMethod · 0.85

Calls 1

ContentMethod · 0.65

Tested by

no test coverage detected