gitlab.com/ethan.reesor/vscode-notebooks/yaegi@v0.0.0-20220417214422-5c573557938e/_test/switch13.go (about) 1 package main 2 3 func main() { 4 var i interface{} 5 6 switch a := i.(type) { 7 case string: 8 println("string", a+" ok") 9 case i: 10 println("i is dummy") 11 default: 12 println("unknown") 13 } 14 } 15 16 // Error: 17 // 9:2: i is not a type