Shortened type switch a bit.

This commit is contained in:
Sascha L. Teichmann 2014-08-31 19:05:43 +02:00
parent 8a474ddd65
commit 48259f14a6

View File

@ -155,11 +155,11 @@ func (rce *RedisCommandExecutor) push(i interface{}) bool {
}
func asString(i interface{}) string {
switch i.(type) {
switch v := i.(type) {
case string:
return i.(string)
return v
case []byte:
return string(i.([]byte))
return string(v)
}
return fmt.Sprintf("%s", i)
}