Newer
Older
01_hello / defer.go
yhornisse on 20 Sep 2021 239 bytes add defer sample
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()
}