go 基础switch

switch

arr1 := []string{"hello","world2"}
switch arr1[1] {
case "hello":
	fmt.Println("hello")
case "world":
	fmt.Println("world")
default:
	fmt.Println("default")
}
posted on 2022-05-17 11:12  每天进步一点点点点点  阅读(30)  评论(0编辑  收藏  举报