From e8f7a874593d7bc0b4aec5bf190f85e49e33257c Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Thu, 9 Dec 2021 18:34:54 +0800 Subject: [PATCH] chore: resolve the lint issue of staticcheck --- pkg/pool/byteslice/byteslice.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/pool/byteslice/byteslice.go b/pkg/pool/byteslice/byteslice.go index fc2e5976d..89e842c4d 100644 --- a/pkg/pool/byteslice/byteslice.go +++ b/pkg/pool/byteslice/byteslice.go @@ -47,7 +47,8 @@ func (p *Pool) Get(size int) []byte { } idx := index(uint32(size)) if v := p.pools[idx].Get(); v != nil { - return v.([]byte)[:size] + bp := v.(*[]byte) + return (*bp)[:size] } return make([]byte, 1<