From 44fd9f3bb02d86f1a742cd880615e1283cf9cdda Mon Sep 17 00:00:00 2001 From: Joel Rebello Date: Thu, 31 Aug 2023 14:56:13 +0200 Subject: [PATCH] Asset errors map: fix lookup --- internal/model/model.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/model/model.go b/internal/model/model.go index 774971762..54def96f5 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -72,13 +72,9 @@ func (a *Asset) AppendError(key CollectorError, value string) { } func (a *Asset) HasError(cErr CollectorError) bool { - for k := range a.Errors { - if k == string(cErr) { - return true - } - } + _, exists := a.Errors[string(cErr)] - return false + return exists } // Config holds application configuration read from a YAML or set by env variables.