Looking at the source code of the module, you can see the type signature returned from Receive will be:
func (c *conn) Receive() (reply interface{}, err error)
and in your case you are using MultiBulk :
func MultiBulk(v interface{}, err error) ([]interface{}, error)
This gives a few interface{}slice answer :[]interface{}
Before untyped, interface{}you must validate your type as follows:
x (T)
Where T- the type (eg int, stringetc.)
(type: []interface{}), , string, , [] , , :
for _, x := range reply {
var v, ok = x.([]byte)
if ok {
fmt.Println(string(v))
}
}
: http://play.golang.org/p/ZifbbZxEeJ
, , :
http://golang.org/ref/spec#Type_switches
for _, y := range reply {
switch i := y.(type) {
case nil:
printString("x is nil")
case int:
printInt(i)
etc...
}
}
, , redis.String .., .
, , , ( !).