MCPcopy
hub / github.com/tidwall/gjson / AddModifier

Function AddModifier

gjson.go:2942–2944  ·  view source on GitHub ↗

AddModifier binds a custom modifier command to the GJSON syntax. This operation is not thread safe and should be executed prior to using all other gjson function.

(name string, fn func(json, arg string) string)

Source from the content-addressed store, hash-verified

2940// This operation is not thread safe and should be executed prior to
2941// using all other gjson function.
2942func AddModifier(name string, fn func(json, arg string) string) {
2943 modifiers[name] = fn
2944}
2945
2946// ModifierExists returns true when the specified modifier exists.
2947func ModifierExists(name string, fn func(json, arg string) string) bool {

Callers 4

TestModifierFunction · 0.85
TestModifierDoubleQuotesFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestModifierFunction · 0.68
TestModifierDoubleQuotesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…