Исходники и презентации
This commit is contained in:
21
lessons/errors/recover_without_defer/main.go
Normal file
21
lessons/errors/recover_without_defer/main.go
Normal file
@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func process2() {
|
||||
fmt.Println(recover())
|
||||
panic("error")
|
||||
fmt.Println(recover())
|
||||
}
|
||||
|
||||
func process1() {
|
||||
fmt.Println(recover())
|
||||
process2()
|
||||
fmt.Println(recover())
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println(recover())
|
||||
process1()
|
||||
fmt.Println(recover())
|
||||
}
|
||||
Reference in New Issue
Block a user