From 76e904a5a4549a8f572b8980a86d6b9fc9c783af Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Thu, 18 Apr 2019 23:12:18 -0500 Subject: [PATCH] CommandComplete.CommandTag is now []byte Avoid allocation --- command_complete.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command_complete.go b/command_complete.go index 0012f6f0..adcc56c8 100644 --- a/command_complete.go +++ b/command_complete.go @@ -8,7 +8,7 @@ import ( ) type CommandComplete struct { - CommandTag string + CommandTag []byte } func (*CommandComplete) Backend() {} @@ -19,7 +19,7 @@ func (dst *CommandComplete) Decode(src []byte) error { return &invalidMessageFormatErr{messageType: "CommandComplete"} } - dst.CommandTag = string(src[:idx]) + dst.CommandTag = src[:idx] return nil } @@ -43,6 +43,6 @@ func (src *CommandComplete) MarshalJSON() ([]byte, error) { CommandTag string }{ Type: "CommandComplete", - CommandTag: src.CommandTag, + CommandTag: string(src.CommandTag), }) }