MarshalBinary() error return value redundant
MrWaggel opened this issue · comments
Gilles commented
err is always nil, is there any reason behind it? I know it probably won't be fixed to avoid breaking changes. But doesn't this cause unneeded overhead, or is the compiler smart enough to ignore this?
// MarshalBinary implements encoding.BinaryMarshaler.
func (uuid UUID) MarshalBinary() ([]byte, error) {
return uuid[:], nil
}
Line 27 in 9b3b1e0
pborman commented
This is satisfying the encoding.BinaryMarshaler interface so it must return the nil.