main.go 266 B

12345678910111213141516171819202122
  1. package main
  2. import "fmt"
  3. func main(){
  4. recovertest()
  5. println("oo")
  6. }
  7. func recovertest()(err error){
  8. defer println("a")
  9. defer func() {
  10. err = recover().(error)
  11. fmt.Println(err)
  12. println(err)
  13. }()
  14. defer println("b")
  15. a := 0
  16. b:= 10/a
  17. println(b)
  18. return
  19. }