From 126368eb43936fb7345a4322543f06c91142e24a Mon Sep 17 00:00:00 2001 From: Dustin Specker Date: Wed, 8 Jan 2025 11:42:13 -0600 Subject: [PATCH] refactor(api/sessionrecording): avoid creating empty struct --- api/sessionrecording/session_recording.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/sessionrecording/session_recording.go b/api/sessionrecording/session_recording.go index 4927e3aed329c..02164aeeb253b 100644 --- a/api/sessionrecording/session_recording.go +++ b/api/sessionrecording/session_recording.go @@ -261,7 +261,7 @@ func (r *Reader) Read(ctx context.Context) (apievents.AuditEvent, error) { if _, err := io.ReadFull(r.gzipReader, messageBytes[:messageSize]); err != nil { return nil, r.setError(trace.ConvertSystemError(err)) } - oneof := apievents.OneOf{} + var oneof apievents.OneOf if err := oneof.Unmarshal(messageBytes[:messageSize]); err != nil { return nil, trace.Wrap(err) }