summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go b/vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go
index 3d3606ddb..1f2734952 100644
--- a/vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go
+++ b/vendor/github.com/jackc/pgx/v5/pgproto3/function_call_response.go
@@ -39,10 +39,8 @@ func (dst *FunctionCallResponse) 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 *FunctionCallResponse) Encode(dst []byte) []byte {
- dst = append(dst, 'V')
- sp := len(dst)
- dst = pgio.AppendInt32(dst, -1)
+func (src *FunctionCallResponse) Encode(dst []byte) ([]byte, error) {
+ dst, sp := beginMessage(dst, 'V')
if src.Result == nil {
dst = pgio.AppendInt32(dst, -1)
@@ -51,9 +49,7 @@ func (src *FunctionCallResponse) Encode(dst []byte) []byte {
dst = append(dst, src.Result...)
}
- pgio.SetInt32(dst[sp:], int32(len(dst[sp:])))
-
- return dst
+ return finishMessage(dst, sp)
}
// MarshalJSON implements encoding/json.Marshaler.