How to find if type is float64 : <p>I am trying to find if a variable is of type float64: </p>

<pre><code>package main
import ("fmt")
func main() {
    myvar := 12.34
    if myvar.(type) == float64 { 
        fmt.Println("Type is float64.")
    }
}
</code></pre>

<p>However, it is not working and giving following error: </p>

<pre><code>./rnFindType.go:6:10: use of .(type) outside type switch
./rnFindType.go:6:21: type float64 is not an expression
</code></pre>

<p>What is the problem and how can it be solved?</p>
