From 3ea2eacf0fe9e52a458f1484cdf114dee76331c8 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Fri, 11 Oct 2024 17:53:23 +0200 Subject: [PATCH] Improve error logging (#97) Eliminate logging of naked `error` values. Signed-off-by: SuperQ --- .golangci.yml | 1 + main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 3c18df5..7472289 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,6 +3,7 @@ linters: enable: - misspell - revive + - sloglint linters-settings: errcheck: diff --git a/main.go b/main.go index d0e6a75..594e59a 100644 --- a/main.go +++ b/main.go @@ -111,7 +111,7 @@ func main() { } landingPage, err := web.NewLandingPage(landingConfig) if err != nil { - logger.Error(err.Error()) + logger.Error("error creating landing page", "err", err) os.Exit(1) } http.Handle("/", landingPage)