MCPcopy
hub / github.com/lmorg/murex / cmdForEach

Function cmdForEach

builtins/core/structs/foreach.go:37–57  ·  view source on GitHub ↗
(p *lang.Process)

Source from the content-addressed store, hash-verified

35}
36
37func cmdForEach(p *lang.Process) error {
38 flags, additional, err := p.Parameters.ParseFlags(argsForEach)
39
40 if err != nil {
41 p.Stdout.SetDataType(types.Null)
42 return err
43 }
44
45 foreachParallelVal, foreachParallelOk := flags.GetNullable(foreachParallel)
46
47 switch {
48 case flags.GetValue(foreachJmap).Boolean():
49 return cmdForEachJmap(p)
50
51 case foreachParallelOk:
52 return cmdForEachParallel(p, foreachParallelVal.Integer(), additional)
53
54 default:
55 return cmdForEachDefault(p, flags.GetValue(foreachStep).Integer(), additional)
56 }
57}
58
59func convertToByte(v any) ([]byte, error) {
60 s, err := types.ConvertGoType(v, types.String)

Callers

nothing calls this directly

Calls 9

cmdForEachJmapFunction · 0.85
cmdForEachParallelFunction · 0.85
cmdForEachDefaultFunction · 0.85
ParseFlagsMethod · 0.80
GetNullableMethod · 0.80
SetDataTypeMethod · 0.65
BooleanMethod · 0.65
GetValueMethod · 0.65
IntegerMethod · 0.65

Tested by

no test coverage detected