TryBugHunt

Go concurrency exercises

Go makes concurrency simple with goroutines and channels, but subtle traps lurk: sending on an unbuffered channel in the same goroutine causes an instant deadlock, loop variables captured in goroutines share state, and forgetting wg.Done() halts execution.

Trace the concurrent execution paths, fix the synchronization bug, and confirm all goroutines complete cleanly.

See the 19 exercisesOr follow the 30-day path

The concurrency bugs you will meet

The exercises

Errors you might be searching for

More JavaScript practice by topic

Questions

How does BugHunt detect Go deadlocks?

The Go runtime includes a built-in deadlock detector. When all goroutines are sleeping on locks or channels, it halts with 'fatal error: all goroutines are asleep - deadlock!'.