aboutsummaryrefslogtreecommitdiff
path: root/internal/bufpool/buffers_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-21 20:55:37 +0800
committerGravatar Runxi Yu2026-02-21 20:55:37 +0800
commit2cb9c32187f0f14f38ab8124466f0ad17f77c5d0 (patch)
treed747cfe22f48a5c134906eb9efed99c471491be8 /internal/bufpool/buffers_test.go
parentinternal/zlib: Fix lints (diff)
signatureNo signature
*: Fix nosec
Diffstat (limited to 'internal/bufpool/buffers_test.go')
-rw-r--r--internal/bufpool/buffers_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/bufpool/buffers_test.go b/internal/bufpool/buffers_test.go
index a690aad1..70861d33 100644
--- a/internal/bufpool/buffers_test.go
+++ b/internal/bufpool/buffers_test.go
@@ -55,7 +55,8 @@ func TestBorrowUsesLargerPools(t *testing.T) {
}
b := Borrow(request)
- if b.pool != poolIndex(classIdx) { //#nosec:G115
+ //#nosec G115
+ if b.pool != poolIndex(classIdx) {
t.Fatalf("expected pooled buffer in class %d, got %d", classIdx, b.pool)
}
if cap(b.buf) != classCap {
@@ -65,7 +66,8 @@ func TestBorrowUsesLargerPools(t *testing.T) {
b2 := Borrow(request)
defer b2.Release()
- if b2.pool != poolIndex(classIdx) { //#nosec:G115
+ //#nosec G115
+ if b2.pool != poolIndex(classIdx) {
t.Fatalf("expected pooled buffer in class %d on reuse, got %d", classIdx, b2.pool)
}
if cap(b2.buf) != classCap {