We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5de0a9 commit f025dc6Copy full SHA for f025dc6
network/network_helpers_test.go
@@ -3,10 +3,10 @@ package network
3
import "encoding/binary"
4
5
func CreatePostgreSQLPacket(typ byte, msg []byte) []byte {
6
- packet := make([]byte, 0, 1+4+len(msg))
+ var packet []byte
7
8
packet = append(packet, typ)
9
- binary.BigEndian.PutUint32(packet, uint32(len(msg)+4))
+ binary.BigEndian.PutUint32(packet[1:], uint32(len(msg)+4))
10
packet = append(packet, msg...)
11
12
return packet
0 commit comments