package main import ( "fmt" "time" ) func hoge() { for i := 0; i < 10; i++ { fmt.Println(i) time.Sleep(1 * time.Second) } } func main() { go hoge() time.Sleep(3 * time.Second) }