Replace MarshalBinary with Encode
This new approach can avoid allocations.
This commit is contained in:
@@ -16,8 +16,8 @@ func (dst *EmptyQueryResponse) Decode(src []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (src *EmptyQueryResponse) MarshalBinary() ([]byte, error) {
|
||||
return []byte{'I', 0, 0, 0, 4}, nil
|
||||
func (src *EmptyQueryResponse) Encode(dst []byte) []byte {
|
||||
return append(dst, 'I', 0, 0, 0, 4)
|
||||
}
|
||||
|
||||
func (src *EmptyQueryResponse) MarshalJSON() ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user