I'm really new to golang and I'm struggling with the basics. I wrote a piece of code like this:
package main
import (
"log"
"reflect"
)
if reflect.TypeOf([]string{"a"}).Elem() == reflect.String {
log.Println("success")
}
if reflect.TypeOf([]int{1}).Elem() == reflect.Int{
log.Println("success")
}
if reflect.TypeOf([]float64{1.00}).Elem() == reflect.Float64 {
log.Println("success")
}
When I run this code, I get the error
invalid operation: reflect.TypeOf([]string literal).Elem() == reflect.String (mismatched types reflect.Type and reflect.Kind)
I don't understand the documentation https://golang.org/pkg/reflect/ because I can't find examples of how to reference the different "types" or "kinds"
How should I be writing my if statements to do the comparisons I'm attempting?