This is an automated archive.
The original was posted on /r/golang by /u/jhoepken on 2023-09-03 11:07:23+00:00.
I’m relatively new to Go, but a seasoned developer in other languages (Python and C++). At the moment I’m developing an API using Gin and have some trouble wrapping my head around how I should do my error handling in a “go way”. On the code level, where I define my handlers, I can return HTTP status codes via Gin. Lower down into the business logic, should I pass errors up (e.g. via fmt.Errorf ?)
How do you do it? Are there are best practices, that I should know?
You must log in or # to comment.