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

Function callFnExecutor

execution/execute_func.go:31–46  ·  view source on GitHub ↗
(f FuncFn, argsE ast.Expressions)

Source from the content-addressed store, hash-verified

29}
30
31func callFnExecutor(f FuncFn, argsE ast.Expressions) (expressionExecutor, error) {
32 return func(ctx context.Context, options *Options, data *model.Value) (*model.Value, error) {
33 ctx = WithExecutorID(ctx, "callFnExpr")
34 args, err := prepareArgs(ctx, options, data, argsE)
35 if err != nil {
36 return nil, fmt.Errorf("error preparing arguments: %w", err)
37 }
38
39 res, err := f(ctx, data, args)
40 if err != nil {
41 return nil, fmt.Errorf("error executing function: %w", err)
42 }
43
44 return res, nil
45 }, nil
46}
47
48var unstableFuncs = []string{
49 "ignore",

Callers 1

callExprExecutorFunction · 0.85

Calls 2

WithExecutorIDFunction · 0.85
prepareArgsFunction · 0.85

Tested by

no test coverage detected