3 pointsby rednafi7 hours ago1 comment
  • rednafi7 hours ago
    I work at one of those large companies where migration work never stops. We recently acquired a few other companies. To coalesce the platforms of multiple companies, we're rewriting a big chunk of our codebase in Go. The new platform itself is also being built from scratch in Go.

    But the catch is we haven't historically been a Go shop. A lot of folks are coming from Python and Kotlin backends. So in our knowledge-sharing channel, we constantly see feature comparisons across these languages.

    One thing that came up recently is how hard structured concurrency feels in Go. go func() is unstructured by default unless you wire it up with sync primitives like WaitGroup. A bunch of people also pointed out how Python’s TaskGroup or Kotlin’s coroutineScope make cancellation feel trivial. In Go, cancellation semantics require explicit context checking and manual bailouts.

    We had some interesting internal discussions around this that I think would be valuable for others going through similar journey.

    So I summarized some of the key points that came up and added a few examples. I’m curious how others approach structured concurrency in Go. How do you avoid the usual leaks that happen with manual plumbing?