MCPcopy Index your code
hub / github.com/CodisLabs/codis / GetString

Method GetString

extern/deprecated/redis-test/utils.go:401–422  ·  view source on GitHub ↗
(c *Conn)

Source from the content-addressed store, hash-verified

399}
400
401func (u *Unit) GetString(c *Conn) {
402 var rsp interface{}
403 defer func() {
404 if x := recover(); x != nil {
405 Panic("get: c = %s, key = '%s', error = '%s', rsp = %v", c.Addr(), u.key, x, rsp)
406 }
407 }()
408 switch u.val.(type) {
409 default:
410 panic("not a string")
411 case string:
412 }
413 var err error
414 if rsp, err = c.Do("get", u.key); err != nil {
415 panic(err)
416 }
417 v := c.String(rsp)
418 s := u.val.(string)
419 if v != s {
420 panic(fmt.Sprintf("return = %s, expect = %s", v, s))
421 }
422}
423
424func (u *Unit) Hset(c *Conn, k, v string) {
425 var rsp interface{}

Callers 1

mainMethod · 0.95

Calls 4

PanicFunction · 0.70
AddrMethod · 0.45
DoMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected