// Chapter 36 example: when main returns, the program ends, goroutines and all. // Run with: go run exercises/36/02-main-ends.go package main import ( "fmt" "time" ) func count(name string) { for i := 1; i <= 3; i++ { fmt.Println(name, i) time.Sleep(100 * time.Millisecond) } } func main() { go count("goroutine") fmt.Println("main is done") }