DEV Community

Aleksei Aleinikov
Aleksei Aleinikov

Posted on

๐Ÿ™ˆ Fifteen if err != nil in a Row? Cut the Noise.

Goโ€™s clarity is great โ€” until your business logic drowns in endless error checks.

I built a tiny lib called try to flip the script:

  • try.Val โ†’ use values directly, errors become panics
  • try.Catch โ†’ one defer to collect them as plain errors
  • try.Async โ†’ safe goroutines without โ€œwho crashed the process?โ€

๐Ÿ’ก Use cases:

  • CSV import in 2 lines
  • DB query without boilerplate
  • Concurrent consumers with built-in safety

๐Ÿ‘‰ Full article: Cut the Noise: Streamlined Go Error Handling with try (2025 Edition)
https://blog.devgenius.io/cut-the-noise-streamlined-go-error-handling-with-try-2025-edition-c381c9277749

Top comments (0)