主页
Go
Go switch 语句
demo_switch5
运行 ❯
×
更改方向
保存代码
更改主题
package main import ("fmt") func main() { a := 3 switch a { case 1: fmt.Println("a is one") case "b": fmt.Println("a is b") } }
./prog.go:11:2: cannot use "b" (type untyped string) as type int