From 471a9591899e9f620c78072693a20b9c0829196d Mon Sep 17 00:00:00 2001 From: Nathan Slaughter <28688390+nslaughter@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:05:20 -0500 Subject: [PATCH] nit: tweak control flow --- pkg/translator/azure/resourcelogs_to_logs.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/translator/azure/resourcelogs_to_logs.go b/pkg/translator/azure/resourcelogs_to_logs.go index 5abd4b1795bd..3d7521b4e9cc 100644 --- a/pkg/translator/azure/resourcelogs_to_logs.go +++ b/pkg/translator/azure/resourcelogs_to_logs.go @@ -108,14 +108,11 @@ func (r ResourceLogsUnmarshaler) UnmarshalLogs(buf []byte) (plog.Logs, error) { for i := 0; i < len(logs); i++ { log := logs[i] + lr := logRecords.AppendEmpty() nanos, err := getTimestamp(log) if err != nil { r.Logger.Warn("Unable to convert timestamp from log", zap.String("timestamp", log.Time)) - } - - lr := logRecords.AppendEmpty() - // only set timestamp if the record sent included a valid value - if err == nil { + } else { lr.SetTimestamp(nanos) } // always set observed timestamp to time observed by Collector