type AppError struct { Code int Message string InternalMessage string Time time.Time HttpCode int }
All my errors are handled in a http handler function. Before that these errors are produced in any functions called by my handler functions.
I concatenate in to the InternalMessage var any error message I want to log, basically anything I want to show an admin. The message tag will have anything I want to show a user. Normally separated by a semicolon.
Because of this I can give good errors to my users, and I have enough information when something goes wrong.
The only negative might be that, the internal error logs are a bit verbose.