Closed komuw closed 3 years ago
With the following
package main import "time" func hello(x time.Duration) {} func main() { x := time.Duration(10_000) hello(x) }
we get the error;
/tmp/ok/main.go:8:7: unconvert: unnecessary conversion (rules.go:30) 7 func main() { 8 x := time.Duration(10_000) 9 hello(x)
However if we change variable x so that it doesn't contain an underscore
x
x := time.Duration(10000)
then we no longer get an error
With the following
we get the error;
However if we change variable
x
so that it doesn't contain an underscorethen we no longer get an error