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

Method RangeList

policy/yaml.go:31–40  ·  view source on GitHub ↗

RangeList iterates over the list and calls the provided function for each element. If the function returns false, the iteration will stop.

(node *yaml.Node, fn func(int, *yaml.Node) bool)

Source from the content-addressed store, hash-verified

29// RangeList iterates over the list and calls the provided function for each element. If the
30// function returns false, the iteration will stop.
31func (yc YAMLHelper) RangeList(node *yaml.Node, fn func(int, *yaml.Node) bool) {
32 if !yc.IsList(node) {
33 return
34 }
35 for i, val := range node.Content {
36 if !fn(i, val) {
37 break
38 }
39 }
40}
41
42// IsMap returns true if the YAML node is a map.
43func (YAMLHelper) IsMap(node *yaml.Node) bool {

Callers 2

TestYAMLHelperFunction · 0.95
parseVariablesMethod · 0.80

Calls 1

IsListMethod · 0.95

Tested by 1

TestYAMLHelperFunction · 0.76