REST API Error Handling in Go - Part 2
I have recently updated the way I handle errors in Go. In some ways, I’ve come full circle back to where I started, in others, I think I’ve evolved. When I initially wrote my errors post in June of 2021, I had come up with a hybrid of Rob Pike’s upspin errors and Dave Cheney’s https://github.com/pkg/errors package. This hybrid works well, however, in December 2021 https://github.com/pkg/errors was archived and, generally, the Go community seems to have opted for a simpler option of adding proper error context and wrapping errors.