diff --git a/wire_proto.go b/wire_proto.go index 7f1b41c..4f8d3ea 100644 --- a/wire_proto.go +++ b/wire_proto.go @@ -4,6 +4,7 @@ import ( "encoding/binary" "io" "net" + "slices" ) var ( @@ -19,6 +20,7 @@ var ( // atomic, and this function is safe to use across goroutines. Otherwise, // writes may be interleaved. func WireWrite(buf *net.Buffers, w io.Writer, attrs []Attr) error { + *buf = slices.Grow(*buf, len(*buf)+len(attrs)*4) for i := range attrs { key := attrs[i].Key.key if key == "" {