mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:33:04 +08:00
因该方法为内部调用建议改为私有
This commit is contained in:
@@ -11,16 +11,16 @@ package main
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
Function1()
|
||||
function1()
|
||||
}
|
||||
|
||||
func Function1() {
|
||||
func function1() {
|
||||
fmt.Printf("In Function1 at the top\n")
|
||||
defer Function2()
|
||||
defer function2()
|
||||
fmt.Printf("In Function1 at the bottom!\n")
|
||||
}
|
||||
|
||||
func Function2() {
|
||||
func function2() {
|
||||
fmt.Printf("Function2: Deferred until the end of the calling function!")
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user