MCPcopy
hub / github.com/redis/go-redis / cmdString

Function cmdString

command.go:321–340  ·  view source on GitHub ↗
(cmd Cmder, val interface{})

Source from the content-addressed store, hash-verified

319}
320
321func cmdString(cmd Cmder, val interface{}) string {
322 b := make([]byte, 0, 64)
323
324 for i, arg := range cmd.Args() {
325 if i > 0 {
326 b = append(b, ' ')
327 }
328 b = internal.AppendArg(b, arg)
329 }
330
331 if err := cmd.Err(); err != nil {
332 b = append(b, ": "...)
333 b = append(b, err.Error()...)
334 } else if val != nil {
335 b = append(b, ": "...)
336 b = internal.AppendArg(b, val)
337 }
338
339 return util.BytesToString(b)
340}
341
342//------------------------------------------------------------------------------
343

Callers 15

StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85

Calls 5

AppendArgFunction · 0.92
BytesToStringFunction · 0.92
ArgsMethod · 0.65
ErrMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected