go-tour/defer-multi.go

14 lines
164 B
Go
Raw Normal View History

2020-02-05 03:44:36 +00:00
package main
import "fmt"
func main () {
fmt.Println("counting")
for i := 0; i < 10; i++ {
defer fmt.Println(i)
}
fmt.Println("done")
}