summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go b/vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go
index 2ce70a477..70fba4a67 100644
--- a/vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go
+++ b/vendor/github.com/jackc/pgx/v5/pgproto3/authentication_sasl_continue.go
@@ -38,17 +38,11 @@ func (dst *AuthenticationSASLContinue) 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 *AuthenticationSASLContinue) Encode(dst []byte) []byte {
- dst = append(dst, 'R')
- sp := len(dst)
- dst = pgio.AppendInt32(dst, -1)
+func (src *AuthenticationSASLContinue) Encode(dst []byte) ([]byte, error) {
+ dst, sp := beginMessage(dst, 'R')
dst = pgio.AppendUint32(dst, AuthTypeSASLContinue)
-
dst = append(dst, src.Data...)
-
- pgio.SetInt32(dst[sp:], int32(len(dst[sp:])))
-
- return dst
+ return finishMessage(dst, sp)
}
// MarshalJSON implements encoding/json.Marshaler.