mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-20 00:50:20 +01:00
Shortened type switch a bit.
This commit is contained in:
parent
8a474ddd65
commit
48259f14a6
@ -155,11 +155,11 @@ func (rce *RedisCommandExecutor) push(i interface{}) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func asString(i interface{}) string {
|
func asString(i interface{}) string {
|
||||||
switch i.(type) {
|
switch v := i.(type) {
|
||||||
case string:
|
case string:
|
||||||
return i.(string)
|
return v
|
||||||
case []byte:
|
case []byte:
|
||||||
return string(i.([]byte))
|
return string(v)
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s", i)
|
return fmt.Sprintf("%s", i)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user