Исходники и презентации
This commit is contained in:
21
lessons/functions/defer_with_function/main.go
Normal file
21
lessons/functions/defer_with_function/main.go
Normal file
@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func get() string {
|
||||
fmt.Println("1")
|
||||
return ""
|
||||
}
|
||||
|
||||
func handle(string) {
|
||||
fmt.Println("3")
|
||||
}
|
||||
|
||||
func process() {
|
||||
defer handle(get())
|
||||
fmt.Println("2")
|
||||
}
|
||||
|
||||
func main() {
|
||||
process()
|
||||
}
|
||||
Reference in New Issue
Block a user