Skip to content

Commit 32e21a6

Browse files
committed
build: Upgrade golangci-lint to v2.9.0 and fix lint issues
Signed-off-by: Guangya Liu <gyliu513@gmail.com>
1 parent 8b7855c commit 32e21a6

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/workflows/ci-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Install golangci-lint without running it
6868
uses: golangci/golangci-lint-action@v8
6969
with:
70-
version: v2.1.6
70+
version: v2.9.0
7171
args: "--help"
7272

7373
- name: Run precommit checks with CGo environment

examples/helper/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func SimulateProduceEvent(ctx context.Context, publisher *Publisher) error {
3737
// Use enough tokens to fill 4 blocks (matching PromptHashes count) at blockSize=16.
3838
tokenIds := make([]uint32, 64)
3939
for i := range tokenIds {
40-
tokenIds[i] = uint32(i + 1) //nolint:gosec // i is bounded by len(tokenIds)=64, no overflow
40+
tokenIds[i] = uint32(i + 1)
4141
}
4242

4343
// Create event in vLLM msgpack array format: [tag, hashes, parent, tokens, blockSize, loraID, medium, loraName]

pkg/kvevents/subscriber_manager_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package kvevents_test
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"testing"
2223
"time"
2324

@@ -199,8 +200,8 @@ func TestSubscriberManager_ConcurrentOperations(t *testing.T) {
199200
for i := 0; i < 10; i++ {
200201
go func(id int) {
201202
defer func() { done <- true }()
202-
podID := "default/pod-" + string(rune('0'+id))
203-
endpoint := "tcp://10.0.0." + string(rune('0'+id)) + ":5557"
203+
podID := fmt.Sprintf("default/pod-%d", id)
204+
endpoint := fmt.Sprintf("tcp://10.0.0.%d:5557", id)
204205
if err := sm.EnsureSubscriber(ctx, podID, endpoint, "kv@", true); err != nil {
205206
t.Errorf("failed to add subscriber %s: %v", podID, err)
206207
}

pkg/kvevents/zmq_subscriber_bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func BenchmarkZMQSubscriber_Throughput(b *testing.B) {
7070
start := time.Now()
7171

7272
for i := 0; i < b.N; i++ {
73-
binary.BigEndian.PutUint64(seqBytes, uint64(i)) //nolint:gosec // i is a non-negative loop counter, conversion is safe
73+
binary.BigEndian.PutUint64(seqBytes, uint64(i))
7474
if err := pub.Send(zmq4.NewMsgFrom(topic, seqBytes, payload)); err != nil {
7575
b.Fatalf("send failed: %v", err)
7676
}

pkg/tokenization/pool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func TestPool_WorkerLoop(t *testing.T) {
161161
setupMocks: func(mt *MockTokenizer) {
162162
for i := range 5 {
163163
prompt := "prompt " + string(rune('a'+i))
164-
tokens := []uint32{uint32(i), uint32(i + 1)} //nolint:gosec // test code
164+
tokens := []uint32{uint32(i), uint32(i + 1)}
165165
offsets := []types.Offset{{0, 6}}
166166

167167
mt.On("Render", prompt).

0 commit comments

Comments
 (0)