summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go b/vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go
index 814027ca1..eba70947d 100644
--- a/vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go
+++ b/vendor/github.com/jackc/pgx/v5/pgproto3/command_complete.go
@@ -3,8 +3,6 @@ package pgproto3
import (
"bytes"
"encoding/json"
-
- "github.com/jackc/pgx/v5/internal/pgio"
)
type CommandComplete struct {
@@ -31,17 +29,11 @@ func (dst *CommandComplete) Decode(src []byte) error {
}
// Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.
-func (src *CommandComplete) Encode(dst []byte) []byte {
- dst = append(dst, 'C')
- sp := len(dst)
- dst = pgio.AppendInt32(dst, -1)
-
+func (src *CommandComplete) Encode(dst []byte) ([]byte, error) {
+ dst, sp := beginMessage(dst, 'C')
dst = append(dst, src.CommandTag...)
dst = append(dst, 0)
-
- pgio.SetInt32(dst[sp:], int32(len(dst[sp:])))
-
- return dst
+ return finishMessage(dst, sp)
}
// MarshalJSON implements encoding/json.Marshaler.