goroutine no wait
A simpler and maybe clearer example for not waiting.
examples/goroutine-nowait/goroutine_nowait.go
package main import ( "fmt" "time" ) func count(n int, name string) { for i := 0; i < n; i++ { fmt.Printf("%s %d\n", name, i) time.Sleep(1000) } } func main() { go count(3, "first") fmt.Println("Done") }
Done