diff --git a/command_complete.go b/command_complete.go index ba5a6a63..85848532 100644 --- a/command_complete.go +++ b/command_complete.go @@ -8,7 +8,7 @@ import ( ) type CommandComplete struct { - CommandTag []byte + CommandTag string } func (*CommandComplete) Backend() {} @@ -19,7 +19,7 @@ func (dst *CommandComplete) Decode(src []byte) error { return &invalidMessageFormatErr{messageType: "CommandComplete"} } - dst.CommandTag = src[:idx] + dst.CommandTag = string(src[:idx]) return nil } @@ -43,6 +43,6 @@ func (src *CommandComplete) MarshalJSON() ([]byte, error) { CommandTag string }{ Type: "CommandComplete", - CommandTag: string(src.CommandTag), + CommandTag: src.CommandTag, }) } diff --git a/row_description.go b/row_description.go index c7f3477f..7deba379 100644 --- a/row_description.go +++ b/row_description.go @@ -14,7 +14,7 @@ const ( ) type FieldDescription struct { - Name []byte + Name string TableOID uint32 TableAttributeNumber uint16 DataTypeOID uint32 @@ -45,7 +45,7 @@ func (dst *RowDescription) Decode(src []byte) error { if err != nil { return err } - fd.Name = bName[:len(bName)-1] + fd.Name = string(bName[:len(bName)-1]) // Since buf.Next() doesn't return an error if we hit the end of the buffer // check Len ahead of time