mirror of
https://github.com/stretchr/testify.git
synced 2025-07-09 03:59:17 +00:00
Avoid unnecessary conversions
No need to convert values here.
This commit is contained in:
parent
3acde138ca
commit
1c7f4ef084
@ -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:
|
||||||
|
@ -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{})),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user