Go每日一题(1)
同步等待 panic defer
package main import( "fmt" ) func main(){ // fmt.Println("Hello World") defer_all() } func defer_all(){ defer func(){ fmt.Println("打印前") }() defer func(){ fmt.Println("打印中") }() defer func(){ fmt.Println("打印后") }() panic("触发异常") }