Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/helper/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// Use enough tokens to fill 4 blocks (matching PromptHashes count) at blockSize=16.
tokenIds := make([]uint32, 64)
for i := range tokenIds {
tokenIds[i] = uint32(i + 1) //nolint:gosec // i is bounded by len(tokenIds)=64, no overflow
tokenIds[i] = uint32(i + 1) // i is bounded by len(tokenIds)=64, no overflow

Check failure on line 40 in examples/helper/events.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion int -> uint32 (gosec)
}

// Create event in vLLM msgpack array format: [tag, hashes, parent, tokens, blockSize, loraID, medium, loraName]
Expand Down
5 changes: 3 additions & 2 deletions pkg/kvevents/subscriber_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package kvevents_test

import (
"context"
"strconv"
"testing"
"time"

Expand Down Expand Up @@ -199,8 +200,8 @@ func TestSubscriberManager_ConcurrentOperations(t *testing.T) {
for i := 0; i < 10; i++ {
go func(id int) {
defer func() { done <- true }()
podID := "default/pod-" + string(rune('0'+id))
endpoint := "tcp://10.0.0." + string(rune('0'+id)) + ":5557"
podID := "default/pod-" + strconv.Itoa(id)
endpoint := "tcp://10.0.0." + strconv.Itoa(id) + ":5557"
if err := sm.EnsureSubscriber(ctx, podID, endpoint, "kv@", true); err != nil {
t.Errorf("failed to add subscriber %s: %v", podID, err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kvevents/zmq_subscriber_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
start := time.Now()

for i := 0; i < b.N; i++ {
binary.BigEndian.PutUint64(seqBytes, uint64(i)) //nolint:gosec // i is a non-negative loop counter, conversion is safe
binary.BigEndian.PutUint64(seqBytes, uint64(i)) // i is a non-negative loop counter, conversion is safe

Check failure on line 73 in pkg/kvevents/zmq_subscriber_bench_test.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion int -> uint64 (gosec)
if err := pub.Send(zmq4.NewMsgFrom(topic, seqBytes, payload)); err != nil {
b.Fatalf("send failed: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/tokenization/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
}, time.Second, 10*time.Millisecond)

// Verify channel is closed
require.Eventually(t, func() bool {

Check failure on line 154 in pkg/tokenization/pool_test.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion int -> uint32 (gosec)

Check failure on line 154 in pkg/tokenization/pool_test.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion int -> uint32 (gosec)
_, ok := <-resultCh
return !ok
}, time.Second, 10*time.Millisecond)
Expand All @@ -161,7 +161,7 @@
setupMocks: func(mt *MockTokenizer) {
for i := range 5 {
prompt := "prompt " + string(rune('a'+i))
tokens := []uint32{uint32(i), uint32(i + 1)} //nolint:gosec // test code
tokens := []uint32{uint32(i), uint32(i + 1)} // i is bounded by range 5, no overflow
offsets := []types.Offset{{0, 6}}

mt.On("Render", prompt).
Expand Down
Loading