github.com/neugram/ng@v0.0.0-20180309130942-d472ff93d872/eval/testdata/typeswitch2.ng (about)

     1  ok := false
     2  
     3  v := interface{}(42)
     4  switch v.(type) {
     5  case *int, []int:
     6  	panic("ERROR-1")
     7  case float64:
     8  	panic("ERROR-2")
     9  default:
    10  	ok = true
    11  }
    12  
    13  if !ok {
    14  	panic("ERROR")
    15  }
    16  
    17  print("OK")