title: golang multiple case in type switch
body: <p>when I run the code snippet bellow, it raise a error</p>
  
  <blockquote>
    <p>a.test undefined (type interface {} is interface with no methods)</p>
  </blockquote>
  
  <p>It seem the type switch does not take effect.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  type A struct {
      a int
  }
  
  func(this *A) test(){
      fmt.Println(this)
  }
  
  type B struct {
      A
  }
  
  func main() {
      var foo interface{}
      foo = A{}
      switch a := foo.(type){
          case B, A:
              a.test()
      }
  }
  </code></pre>
  
  <p>If I change it to </p>
  
  <pre><code>    switch a := foo.(type){
          case A:
              a.test()
      }
  </code></pre>
  
  <p>it's ok now.</p>