Replace MarshalBinary with Encode
This new approach can avoid allocations.
This commit is contained in:
+2
-2
@@ -8,6 +8,6 @@ func (dst *NoticeResponse) Decode(src []byte) error {
|
||||
return (*ErrorResponse)(dst).Decode(src)
|
||||
}
|
||||
|
||||
func (src *NoticeResponse) MarshalBinary() ([]byte, error) {
|
||||
return (*ErrorResponse)(src).marshalBinary('N')
|
||||
func (src *NoticeResponse) Encode(dst []byte) []byte {
|
||||
return append(dst, (*ErrorResponse)(src).marshalBinary('N')...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user