TryBugHunt

Go debugging exercises

Go's simplicity is intentional, but its concurrent runtime has sharp corners: assigning to a nil map panics immediately, unbuffered channels deadlock if nobody is listening, and passing a struct with a value receiver quietly drops mutations.

These exercises train you to spot and fix real Go defects: from slice capacity and pointer receivers to WaitGroup race conditions and goroutine channel coordination.

See the exercisesDo it as a 30-day pathFilter and search

Practise by topic

How to debug a Go function

  1. Read the panic message carefully. Go's runtime panics pinpoint the exact file, line, and goroutine stack trace.
  2. Check pointer vs value receivers. If a method does not mutate the struct as expected, check whether the receiver is (c *Counter) or (c Counter).
  3. Trace channel buffers and closing semantics. An unbuffered channel requires an active receiver in another goroutine; closing a closed channel panics immediately.
  4. Check slice length vs capacity. Appending beyond capacity reallocates the underlying array, discarding mutations in callers if the slice header was not returned.
  5. Verify goroutine closures. In loops before Go 1.22, range loop variables must be passed as arguments or re-scoped inside the iteration.

The exercises

Medium

What you will practise

Questions

Do I need to install the Go compiler?

No. All Go exercises execute and verify tests directly through BugHunt without requiring any local toolchain installation.

Which Go version is targeted?

Modern Go 1.22+ semantics, including standard library packages sync, context, time, and math/rand.

Is there a certificate?

Yes, free. Solving Go challenges earns LinkedIn-verified debugging credentials.