package main
import "fmt"
func test1(){
fmt.Println("aaaaaaaaaaa")
}
func test2(x int){
fmt.Println("bbbbbbbbb")
//1显示调用panic,使程序崩溃
//panic("this is a panic test !!!")
//2报错显示panic
var a[10] int
a[x]=20
}
func test3(){
fmt.Println("ccccccc")
}
func main(){
test1()
test2(2)
test3()
}
4.12 go panic函数
猜你喜欢
转载自blog.csdn.net/h4241778/article/details/105347396
今日推荐
周排行