Avoid unnecessary conversions

No need to convert values here.
pull/910/head
Christian Muehlhaeuser 2019-07-19 23:54:32 +02:00 committed by Boyan Soubachov
parent 3acde138ca
commit 1c7f4ef084
2 changed files with 4 additions and 4 deletions

View File

@ -1092,7 +1092,7 @@ func toFloat(x interface{}) (float64, bool) {
case float32: case float32:
xf = float64(xn) xf = float64(xn)
case float64: case float64:
xf = float64(xn) xf = xn
case time.Duration: case time.Duration:
xf = float64(xn) xf = float64(xn)
default: default:

View File

@ -74,11 +74,11 @@ var (
[1]interface{}{1}, [1]interface{}{1},
[]interface{}{}, []interface{}{},
struct{ x int }{1}, struct{ x int }{1},
(*interface{})(&i), (&i),
(func())(func() {}), (func() {}),
interface{}(1), interface{}(1),
map[interface{}]interface{}{}, map[interface{}]interface{}{},
(chan interface{})(make(chan interface{})), (make(chan interface{})),
(<-chan interface{})(make(chan interface{})), (<-chan interface{})(make(chan interface{})),
(chan<- interface{})(make(chan interface{})), (chan<- interface{})(make(chan interface{})),
} }