(options *Options, e ast.CallExpr)
| 50 | } |
| 51 | |
| 52 | func callExprExecutor(options *Options, e ast.CallExpr) (expressionExecutor, error) { |
| 53 | if !options.Unstable && (slices.Contains(unstableFuncs, e.Function)) { |
| 54 | return nil, errors.New("unstable function are not enabled. to enable them use --unstable") |
| 55 | } |
| 56 | if f, ok := options.Funcs.Get(e.Function); ok { |
| 57 | res, err := callFnExecutor(f, e.Args) |
| 58 | if err != nil { |
| 59 | return nil, fmt.Errorf("error executing function %q: %w", e.Function, err) |
| 60 | } |
| 61 | return res, nil |
| 62 | } |
| 63 | |
| 64 | return nil, fmt.Errorf("unknown function: %q", e.Function) |
| 65 | } |
no test coverage detected