Skip to content

Commit e688274

Browse files
twmbclaude
andcommitted
all: fix lints
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4b939b1 commit e688274

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

generate/validate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ func TestValidateMiscDSLAgainstKafkaJSON(t *testing.T) {
674674

675675
for _, m := range mappings {
676676
jsonPath := filepath.Join(kafkaDir, m.jsonPath)
677-
data, err := os.ReadFile(jsonPath)
677+
data, err := os.ReadFile(jsonPath) //nolint:gosec // path is constructed from test constant + env var, not user input
678678
if err != nil {
679679
t.Errorf("reading %s: %v", m.jsonPath, err)
680680
continue

pkg/kgo/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ type cfg struct {
186186
sessionTimeout time.Duration
187187
rebalanceTimeout time.Duration
188188
heartbeatInterval time.Duration
189+
189190
onAssigned func(context.Context, *Client, map[string][]int32)
190191
onRevoked func(context.Context, *Client, map[string][]int32)
191192
onLost func(context.Context, *Client, map[string][]int32)
@@ -1736,7 +1737,7 @@ func HeartbeatInterval(interval time.Duration) GroupOpt {
17361737
// Deprecated: RequireStable is now permanently enabled for all group
17371738
// consumers. This function is a no-op.
17381739
func RequireStableFetchOffsets() GroupOpt {
1739-
return groupOpt{func(cfg *cfg) {}}
1740+
return groupOpt{func(*cfg) {}}
17401741
}
17411742

17421743
// BlockRebalanceOnPoll switches the client to block rebalances whenever you

pkg/kgo/helpers_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ func testLogger() Logger {
275275
// (e.g. "OUT_OF_ORDER_SEQUENCE_NUMBER"). When a match is found, the entire
276276
// backlog is dumped first, then the triggering message, so the output shows
277277
// full context leading up to the event.
278+
var _ = newRingLogger(nil, 0).flush
279+
278280
type ringLogEntry struct {
279281
level LogLevel
280282
msg string
@@ -294,7 +296,7 @@ func newRingLogger(real Logger, size int) *ringLogger {
294296
return &ringLogger{buf: make([]ringLogEntry, size), size: size, real: real}
295297
}
296298

297-
func (r *ringLogger) Level() LogLevel { return LogLevelDebug }
299+
func (*ringLogger) Level() LogLevel { return LogLevelDebug }
298300

299301
func (r *ringLogger) Log(level LogLevel, msg string, keyvals ...any) {
300302
r.mu.Lock()
@@ -321,7 +323,7 @@ func (r *ringLogger) Log(level LogLevel, msg string, keyvals ...any) {
321323
}
322324
}
323325

324-
func (r *ringLogger) shouldFlush(msg string, keyvals []any) bool {
326+
func (*ringLogger) shouldFlush(msg string, keyvals []any) bool {
325327
// Add needle strings here to auto-flush on specific log patterns.
326328
// Check both msg and keyvals, since error text can appear in either
327329
// depending on the code path.
@@ -381,15 +383,15 @@ type chaosConn struct {
381383

382384
func (c *chaosConn) Read(p []byte) (int, error) {
383385
if time.Now().After(c.deadline) {
384-
c.once.Do(func() { c.Conn.Close() })
386+
c.once.Do(func() { c.Close() })
385387
return 0, net.ErrClosed
386388
}
387389
return c.Conn.Read(p)
388390
}
389391

390392
func (c *chaosConn) Write(p []byte) (int, error) {
391393
if time.Now().After(c.deadline) {
392-
c.once.Do(func() { c.Conn.Close() })
394+
c.once.Do(func() { c.Close() })
393395
return 0, net.ErrClosed
394396
}
395397
return c.Conn.Write(p)

0 commit comments

Comments
 (0)