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