Re: Pointer Receivers on Error() and String() methods

2015-08-24 Thread Nate Finch
That's fair. I wasn't sure if recovering the panic in errors would be a good idea, since it could hide programmer error (like what I'd done). But I'm fine with that solution. On Mon, Aug 24, 2015 at 3:22 AM David Cheney david.che...@canonical.com wrote: Yup, I agree with Rog. This is fixing

Re: Pointer Receivers on Error() and String() methods

2015-08-24 Thread roger peppe
I'm afraid I'm not convinced. Declaring the Error method on the pointer receiver is idiomatic (just grep for ' Error\(' in the Go source) and is a useful indicator that the error value is always intended to be a pointer. There's a much simpler fix for this: let the errors package recover from

Re: Pointer Receivers on Error() and String() methods

2015-08-24 Thread David Cheney
Yup, I agree with Rog. This is fixing the problem in the wrong place. On Mon, Aug 24, 2015 at 5:14 PM, roger peppe roger.pe...@canonical.com wrote: I'm afraid I'm not convinced. Declaring the Error method on the pointer receiver is idiomatic (just grep for ' Error\(' in the Go source) and is a