Skip to content

Commit 176ac69

Browse files
author
James Cor
committed
use slice instead
1 parent 666568b commit 176ac69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/byte_buffer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ const bufCap = 4096 // 4KB
2424
// byteBuffer serves as a statically sized backing array used to the wire methods (types.SQL() and types.SQLValue())
2525
type byteBuffer struct {
2626
pos uint16
27-
buf [bufCap]byte
27+
buf []byte
2828
}
2929

3030
var bufferPool = sync.Pool{
3131
New: func() any {
32-
return &byteBuffer{}
32+
return &byteBuffer{
33+
buf: make([]byte, bufCap),
34+
}
3335
},
3436
}
3537

0 commit comments

Comments
 (0)