From 0726b50cfd228ec3deb38f4a7a1793d6cf3540ca Mon Sep 17 00:00:00 2001 From: Eduardo Sfreddo Trindade Date: Tue, 4 Jun 2024 14:06:11 +0200 Subject: [PATCH] chore(cli): update golangci and fix new issues --- .github/workflows/validate.yml | 2 +- .golangci.yml | 2 +- cli/cmd/log/log_events.go | 2 +- cli/dotenv/dotenv.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 76bf9e7..8c48421 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -102,7 +102,7 @@ jobs: - name: Lint (golangci-lint) uses: golangci/golangci-lint-action@v4 with: - version: v1.56.2 + version: v1.59.0 working-directory: cli args: --config=../.golangci.yml --verbose - name: Install gofumpt diff --git a/.golangci.yml b/.golangci.yml index 08f6e2f..fd08697 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,7 +12,7 @@ linters-settings: linters: enable: - gocritic - - gomnd + - mnd - misspell - nlreturn - perfsprint diff --git a/cli/cmd/log/log_events.go b/cli/cmd/log/log_events.go index 2d39fe3..5c5038d 100644 --- a/cli/cmd/log/log_events.go +++ b/cli/cmd/log/log_events.go @@ -81,7 +81,7 @@ func printVerbose(out io.Writer, entry LogEntry, timestamps, verbose bool) { } if _, err := out.Write([]byte(logMsg)); err != nil { - slog.Error("Error writing message", err) + slog.Error("Error writing message", slog.String("error", err.Error())) } } diff --git a/cli/dotenv/dotenv.go b/cli/dotenv/dotenv.go index 5d3f899..84e1abc 100644 --- a/cli/dotenv/dotenv.go +++ b/cli/dotenv/dotenv.go @@ -31,8 +31,8 @@ func parse(content []byte) map[string]string { envLine = envLine[:commentIdx] } - keyvalue := strings.SplitN(envLine, "=", 2) // nolint: gomnd - if len(keyvalue) != 2 { // nolint: gomnd + keyvalue := strings.SplitN(envLine, "=", 2) // nolint: mnd + if len(keyvalue) != 2 { // nolint: mnd continue }