MCPcopy
hub / github.com/TomWright/dasel / callExprExecutor

Function callExprExecutor

execution/execute_func.go:52–65  ·  view source on GitHub ↗
(options *Options, e ast.CallExpr)

Source from the content-addressed store, hash-verified

50}
51
52func 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}

Callers 1

exprExecutorFunction · 0.85

Calls 2

callFnExecutorFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected