by BoorishBears · 5y ago · 0 comments
But I also think the stack trace message example is the perfect example of what I mean by "take the Go mentality with you"
In a language like Kotlin for example, Go got my in the habit of attaching more information to exceptions as they bubble up.
I was already generally in the habit of wrapping library exceptions, but I started religiously using a Result nomad implementation and wrapping errors with additional information so that my stack traces looked very "Go-like" in terms of human readability, but kept traditional stack trace information.
It's small things that I think using Go makes you "re-appreciate" in other languages
github.com/pkg/errors is a simple way to dump expensive stacktraces into each new/wrapped error. Or you can just panic and recover in your own app, it's possible though discouraged.