title: how to use reflect.TypeOf([]string{"a"}).Elem()?
body: <p>I'm really new to golang and I'm struggling with the basics. I wrote a piece of code like this:</p>
  
  <pre><code>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")
  }
  </code></pre>
  
  <p>When I run this code, I get the error</p>
  
  <blockquote>
    <p>invalid operation: reflect.TypeOf([]string literal).Elem() ==
    reflect.String (mismatched types reflect.Type and reflect.Kind)</p>
  </blockquote>
  
  <p>I don't understand the documentation  <a href="https://golang.org/pkg/reflect/" rel="nofollow noreferrer">https://golang.org/pkg/reflect/</a> because I can't find examples of how to reference the different "types" or "kinds"</p>
  
  <p>How should I be writing my if statements to do the comparisons I'm attempting?</p>