diff --git a/defer.go b/defer.go new file mode 100755 index 0000000..6d20e13 --- /dev/null +++ b/defer.go @@ -0,0 +1,21 @@ +package main + +import "fmt" + + +func hoge() { + defer fmt.Println("3") // 4th + defer fmt.Println("4") // 3rd + fmt.Println("5") // 2nd +} + +func fuga() { + defer fmt.Println("1") // 5th + fmt.Println("2") // 1st + hoge() +} + +func main() { + fuga() +} +