Closed MrWaggel closed 5 years ago
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 }
https://github.com/google/uuid/blob/9b3b1e0f5f99ae461456d768e7d301a7acdaa2d8/marshal.go#L27
This is satisfying the encoding.BinaryMarshaler interface so it must return the nil.
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?
https://github.com/google/uuid/blob/9b3b1e0f5f99ae461456d768e7d301a7acdaa2d8/marshal.go#L27