Comment

Comment by randomdata

Go exceptions do carry stack trace information.

However, the topic is errors, not exceptions. Those are very different concepts. Of what use is stack trace information in debugging values that you have assigned error meaning to when not other types of values?

If you had a function

   func add(a, b int) int { return a * b }
there would be no expectation of carrying a stack trace to debug it. So what's different about

   func add(a, b int) error { return errors.New("cannot add") }
that does require a stack trace?
parent randomdata 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton