News for hackers. Stuff that matters.
Re:Error handling in Go web apps shouldn't be so awkward by Thaxll on Tuesday January 09, 2024 @09:30PM (#38935403)
But this is a detail of implementation, user code does not use reflection with errors.
Re:Error handling in Go web apps shouldn't be so awkward by sidlls on Tuesday January 09, 2024 @09:35PM (#38935433)
That "detail of implementation" is what is used by user code, e.g., `myError.As(...)` uses reflection, implicitly.
Re:Error handling in Go web apps shouldn't be so awkward by Thaxll on Tuesday January 09, 2024 @09:45PM (#38935491)
Then what? It has 0 performance impact, we're talking about error handling here, it's rare and not in hot path.
Re:Error handling in Go web apps shouldn't be so awkward by sidlls on Wednesday January 10, 2024 @09:19AM (#38939242)
It does not have 0 performance impact, it's not rare, and in applications that are in the hot path, error handling is also in the hot path.
Re:Error handling in Go web apps shouldn't be so awkward by Thaxll on Wednesday January 10, 2024 @06:56PM (#38945386)
No, it only executes when you enter the err != nil block so it's almost never called, again 0 impact on performance.