From 1dd1fe9e72bbc85f6c35ed0398a6384bdfcac5d1 Mon Sep 17 00:00:00 2001 From: Junio Cezar Date: Tue, 12 Jul 2022 11:36:21 -0300 Subject: [PATCH] Handle fatal error: converted pointer straddles multiple allocations (#3) --- buffer/pool.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buffer/pool.go b/buffer/pool.go index 457a844b..18a911ee 100644 --- a/buffer/pool.go +++ b/buffer/pool.go @@ -68,8 +68,7 @@ func getBuf(size int) []byte { // Get back the array and add length and capability. // Limiting the array to the proper capability will make this // safe. - buf := (*[maxArraySize]byte)(v.(unsafe.Pointer)) - return buf[:0:size] + return (*[maxArraySize]byte)(v.(unsafe.Pointer))[:0:size] } } }