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

2015-08-25 Thread roger peppe
inside does not try to derefence the pointer to get to a field). Grepping through our code, I see a lot of pointer receivers on Error and String methods (45 and 77 respectively). I think we should at least change all of these to be value methods (unless that's not possible. That's

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

2015-08-24 Thread Nate Finch
on a nil pointer is totally fine and will not panic if the code inside does not try to derefence the pointer to get to a field). Grepping through our code, I see a lot of pointer receivers on Error and String methods (45 and 77 respectively). I think we should at least change all

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

2015-08-24 Thread roger peppe
the pointer to e to access the Message field which causes the panic. Calling a method on a nil pointer is totally fine and will not panic if the code inside does not try to derefence the pointer to get to a field). Grepping through our code, I see a lot of pointer receivers on Error and String

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

2015-08-24 Thread David Cheney
if the code inside does not try to derefence the pointer to get to a field). Grepping through our code, I see a lot of pointer receivers on Error and String methods (45 and 77 respectively). I think we should at least change all of these to be value methods (unless that's not possible. That's

Pointer Receivers on Error() and String() methods

2015-08-19 Thread Nate Finch
that it is dereferencing the pointer to e to access the Message field which causes the panic. Calling a method on a nil pointer is totally fine and will not panic if the code inside does not try to derefence the pointer to get to a field). Grepping through our code, I see a lot of pointer receivers on Error