title: How do I distinguish a rune and int32 values in a typeswitch?
body: <p>Having the following code</p>
  
  <pre><code>var v interface{}
  v = rune(1)
  
  switch v.(type) {
      case int32:
          fmt.Println("int32")
      case rune:
          fmt.Println("rune")
  }
  </code></pre>
  
  <p>I get a compilation error</p>
  
  <pre><code>tmp/sandbox193184648/main.go:14: duplicate case rune in type switch
      previous case at tmp/sandbox193184648/main.go:12
  </code></pre>
  
  <p>If I instead wrap the rune in my own type, the type-switch compiles and works</p>
  
  <pre><code>type myrune rune
  
  var v interface{}
  v = myrune(1)
  
  switch v.(type) {
  case int32:
      fmt.Println("int32")
  case myrune:
      fmt.Println("rune")
  }
  </code></pre>
  
  <p>see <a href="https://play.golang.org/p/2lMRlpCLzX" rel="nofollow noreferrer">https://play.golang.org/p/2lMRlpCLzX</a></p>
  
  <p>Why is that? How can I distinguish a rune and int32 in a type-switch?</p>