From bc76a1b5390556d3f897d5c826dc9130950bf403 Mon Sep 17 00:00:00 2001 From: Gabriel Corado Date: Mon, 23 Dec 2024 16:28:38 -0300 Subject: [PATCH] chore(lib): fix lint --- lib/auth/auth_with_roles_test.go | 2 +- lib/events/auditlog.go | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/auth/auth_with_roles_test.go b/lib/auth/auth_with_roles_test.go index 68dd311cad2c4..f6ad5315cd6fb 100644 --- a/lib/auth/auth_with_roles_test.go +++ b/lib/auth/auth_with_roles_test.go @@ -2322,7 +2322,7 @@ func TestStreamSessionEvents_SessionType(t *testing.T) { require.NoError(t, stream.Complete(ctx)) accessedFormat := teleport.PTY - clt.StreamSessionEvents(metadata.WithSessionRecordingFormatContext(ctx, accessedFormat), session.ID(sessionID), 0) + clt.StreamSessionEvents(metadata.WithSessionRecordingFormatContext(ctx, accessedFormat), sessionID, 0) // Perform the listing an eventually loop to ensure the event is emitted. var searchEvents []apievents.AuditEvent diff --git a/lib/events/auditlog.go b/lib/events/auditlog.go index 4303db80a296d..220b8f316cbe1 100644 --- a/lib/events/auditlog.go +++ b/lib/events/auditlog.go @@ -512,15 +512,13 @@ func (l *AuditLog) StreamSessionEvents(ctx context.Context, sessionID session.ID sessionStartCh := make(chan apievents.AuditEvent, 1) if startCb, err := SessionStartCallbackFromContext(ctx); err == nil { go func() { - select { - case evt, ok := <-sessionStartCh: - if !ok { - startCb(nil, trace.NotFound("session start event not found")) - return - } - - startCb(evt, nil) + evt, ok := <-sessionStartCh + if !ok { + startCb(nil, trace.NotFound("session start event not found")) + return } + + startCb(evt, nil) }() }