summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go b/vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go
index 12c608170..23f5da677 100644
--- a/vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go
+++ b/vendor/github.com/jackc/pgx/v5/pgproto3/backend_key_data.go
@@ -29,12 +29,11 @@ func (dst *BackendKeyData) 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 *BackendKeyData) Encode(dst []byte) []byte {
- dst = append(dst, 'K')
- dst = pgio.AppendUint32(dst, 12)
+func (src *BackendKeyData) Encode(dst []byte) ([]byte, error) {
+ dst, sp := beginMessage(dst, 'K')
dst = pgio.AppendUint32(dst, src.ProcessID)
dst = pgio.AppendUint32(dst, src.SecretKey)
- return dst
+ return finishMessage(dst, sp)
}
// MarshalJSON implements encoding/json.Marshaler.