From fb1cf32e17f2dd007efc979c8cbb3fc80786f2e6 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Fri, 19 Apr 2024 09:35:36 +0200 Subject: [PATCH] Fixed linting errors --- cmd/csaf_aggregator/config.go | 2 +- internal/options/options.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/csaf_aggregator/config.go b/cmd/csaf_aggregator/config.go index 2a2bef2..f1e602d 100644 --- a/cmd/csaf_aggregator/config.go +++ b/cmd/csaf_aggregator/config.go @@ -396,7 +396,7 @@ func (c *config) setDefaults() { } // prepareLogging sets up the structured logging. -func (cfg *config) prepareLogging() error { +func (c *config) prepareLogging() error { ho := slog.HandlerOptions{ Level: slog.LevelDebug, } diff --git a/internal/options/options.go b/internal/options/options.go index ffd699b..d8574ff 100644 --- a/internal/options/options.go +++ b/internal/options/options.go @@ -149,8 +149,9 @@ func ErrorCheck(err error) { } } -// ErrorCheck checks if err is not nil and terminates -// the program if so. +// ErrorCheckStructured checks if err is not nil and terminates the program if +// so. This is similar to [ErrorCheck], but uses [slog] instead of the +// non-structured Go logging. func ErrorCheckStructured(err error) { if err != nil { slog.Error("Error while executing program", "err", err)