Foreach adds iteration capabilities to the rule language. The decision to keep the function implementation outside the functions package is deliberate. The function mostly operates with raw expressions, and if the function lived in the functions package, that would create a cyclic import and likely
| 156 | // foreach(ps._ancestors, $proc, $proc.name = 'services.exe' and ps.is_protected, ps.is_protected) |
| 157 | // In this example, the ps.is_protected field is captured prior to its usage in the predicate |
| 158 | type Foreach struct{} |
| 159 | |
| 160 | func (f *Foreach) Call(args []interface{}) (interface{}, bool) { |
| 161 | if len(args) < 3 { |
nothing calls this directly
no outgoing calls
no test coverage detected