bindMessageBody builds a Bind message body (without the type byte and length prefix) for portal/statement names with raw trailing fields.
(portal, stmt string, fields ...any)
| 27 | // bindMessageBody builds a Bind message body (without the type byte and |
| 28 | // length prefix) for portal/statement names with raw trailing fields. |
| 29 | func bindMessageBody(portal, stmt string, fields ...any) []byte { |
| 30 | var buf bytes.Buffer |
| 31 | buf.WriteString(portal) |
| 32 | buf.WriteByte(0) |
| 33 | buf.WriteString(stmt) |
| 34 | buf.WriteByte(0) |
| 35 | for _, f := range fields { |
| 36 | _ = binary.Write(&buf, binary.BigEndian, f) |
| 37 | } |
| 38 | return buf.Bytes() |
| 39 | } |
| 40 | |
| 41 | func newBindTestConn(out *bytes.Buffer) *clientConn { |
| 42 | return &clientConn{ |
no test coverage detected