MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / autoQuote

Function autoQuote

pkg/exprhelpers/debugger.go:143–155  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

141}
142
143func autoQuote(v any) string {
144 switch x := v.(type) {
145 case string:
146 // let's avoid printing long strings. it can happen ie. when we are debugging expr with `File()` or similar helpers
147 if len(x) > 40 {
148 return fmt.Sprintf("%q", x[:40]+"...")
149 }
150
151 return fmt.Sprintf("%q", x)
152 default:
153 return fmt.Sprintf("%v", x)
154 }
155}
156
157type opHandler func(out OpOutput, prevOut *OpOutput, ip int, parts []string, vm *vm.VM, program *vm.Program) *OpOutput
158

Callers 8

opCall1Function · 0.85
opCall2Function · 0.85
opCall3Function · 0.85
opCallNFunction · 0.85
opEqualFunction · 0.85
opInFunction · 0.85
opContainsFunction · 0.85
ipDebugMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…