Boldly Go
Blog YouTube Hire Me Contact Daily Email
Boldly Go
Blog YouTube Hire Me Contact Daily Email
Go Routines

2 min read


Waiting for goroutines

Yesterday we looked at some sample code with goroutines: for i := range 10 { go func() { fmt.Println(i) }() } But if you ran it, you probably saw no output. This is because the main goroutine exits before the 10 new goroutines have a chance to run. How do we solve this? We need some sort of synchronization mechanism in place, to ensure we wait for all goroutines to finish before exiting the program.

Go Routines

3 min read


Goroutines

Today I’m starting a new series of posts on the topic of goroutines. In the past, I’ve mostly walked through existing documentation (the Go spec, docs for standard library packages, etc), and provided my commentary and explanation. Starting today, instead, I’ll be going on a topical journey through goroutines. I will, of course, touch on the spec, and some standard library packages, but I’ll be taking my own path through the topic.

  • ←
  • Previous
  • 1
  • 2

My Content

  • Boldly Go: Daily
  • YouTube

My Services

  • Dev Subscription
  • Private Mentoring

About me

  • Contact Me
  • Privacy Policy

Subscribe to Boldly Go: Daily

Daily suggestions to improve your control of the Go language. I will respect your inbox, and honor my privacy policy.

Not convinced? Browse the archive.

© 2025 Jonathan Hall. All rights reserved.