2 ms·
That's the point, it's not the same messages. Each error wrap has a situation-dependent wrapping message, different for each wrapped error in the function. Co
by cube2222 4y ago
That's the point, it's not the same messages.
Each error wrap has a situation-dependent wrapping message, different for each wrapped error in the function.
Copilot is great at writing the whole `if err != nil`, including context-specific wrapping messages. It's also great at writing your code in many other situations where the intent is clear and simple, but it just takes a few lines to write in Go.
I'm not sure if you've ever used Copilot yourself, but it's basically autocomplete on steroids.
- sanderjd 4y agoYes, the point I was trying to make is that it works because the error messages are formulaic. In which case I think it's too bad the whole pattern can't be abstracted.