Show HN: Error return traces for Go, inspired by Zig

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. errtrace

    An alternative to stack traces for your Go errors

    The README covers the idea behind errtrace in more details, but the primary difference is in what is captured:

    pkg/errors captures a stack trace of when the error occurred, and attaches it to the error. This information doesn't change as the error moves through the program.

    errtrace captures a 'return trace'--every 'return' statement that the error passes through. This information is appended to at each return site.

    This gives you a different view of the code path: the stack trace is the path that led to the error, while the return trace is the path that the error took to get to the user.

    The difference is significant because in Go, errors are just plain values that you can store in a struct, pass between goroutines etc. When the error passes to another goroutine, the stack trace from the original goroutine can become less useful in debugging the root cause of the error.

    As an example, the [Try it out](https://github.com/bracesdev/errtrace/#try-it-out) section in the README includes an example of a semi-realistic program comparing the stack trace and the return trace for the same failure.

  2. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  3. errors

    Discontinued Simple error handling primitives

    Can you explain why we should this over https://github.com/pkg/errors?

  4. ez

    Minimalistic package for handling Go errors in an easy way (by Vanclief)

    While from a first instance, this package seems a bit overkill, I think the idea is interesting and is something that can be improved for Go.

    I also felt that Go errors where too bare-bones, so I developed a small package (https://github.com/Vanclief/ez) based on an awesome post that I saw here once. I use this package in all Golang code I touch.

  5. zig

    General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

    https://github.com/ziglang/zig/issues/7295

    Or is it that the three years it’s been around indicate it will never progress?

  6. golangci-lint

    Fast linters runner for Go

    The "standard linter" in Go is https://golangci-lint.run/ , which includes [1] the absolutely-vital errcheck which will do that for you.

    For an Advent of Code challenge you may want to turn off a lot of other things, since the linter is broadly tuned for production, public code by default and you're creating burner code and don't care whether or not you have godoc comments for your functions, for instance. But I suggest using golangci-lint rather than errcheck directly because there's some other things you may find useful, like ineffassign, exportloopref, etc.

    [1]: https://golangci-lint.run/usage/linters/

  7. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Monitor Your Services with Gatus + Docker (Alternative to Uptime Kuma)

    1 project | dev.to | 11 Apr 2025
  • Go's Race Detector: The Bugs It Misses and Why You Should Care

    2 projects | dev.to | 8 Apr 2025
  • Dependency Injection in Go: Comparing Wire, Dig, Fx & More

    5 projects | dev.to | 5 Feb 2025
  • Golang Web: PATCH Method

    4 projects | dev.to | 2 Feb 2025
  • Golang on PSP (and other languages)

    3 projects | dev.to | 27 Dec 2024