From 26149a7689dca9c8d813e6b5b51a312a858a23c6 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Tue, 20 Aug 2024 09:08:56 +0200 Subject: [PATCH] Update linter to 1.60.1 --- Makefile | 2 +- pkg/config/config/config.go | 2 +- pkg/i18n/i18n.go | 4 ++-- worker/mails/mail_test.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 56ca28a8f53..ab86a28d705 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ lint: scripts/golangci-lint .PHONY: lint scripts/golangci-lint: Makefile - @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./scripts v1.58.1 + @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./scripts v1.60.1 ## jslint: enforce a consistent code style for Js code jslint: scripts/node_modules diff --git a/pkg/config/config/config.go b/pkg/config/config/config.go index d5abdf966dd..a8cff1760a6 100644 --- a/pkg/config/config/config.go +++ b/pkg/config/config/config.go @@ -478,7 +478,7 @@ func Setup(cfgFile string) (err error) { if err := viper.MergeConfig(dest); err != nil { if _, isParseErr := err.(viper.ConfigParseError); isParseErr { log.Errorf("Failed to read cozy-stack configurations from %s", cfgFile) - log.Errorf(dest.String()) + log.Errorf("%s", dest.String()) return err } } diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 230979f01bf..e1b7dde125f 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -51,7 +51,7 @@ func TranslatorHTML(locale, contextName string) func(key string, vars ...interfa // Translate translates the given key on the specified locale. func Translate(key, locale, contextName string, vars ...interface{}) string { if po, ok := translations[contextName+"/"+locale]; ok { - translated := po.Get(key) + translated := po.Get(key) //nolint:govet // key is given by the stack and is safe if translated != key && translated != "" { if len(vars) > 0 { return fmt.Sprintf(translated, vars...) @@ -60,7 +60,7 @@ func Translate(key, locale, contextName string, vars ...interface{}) string { } } if po, ok := translations[locale]; ok { - translated := po.Get(key) + translated := po.Get(key) //nolint:govet // key is given by the stack and is safe if translated != key && translated != "" { if len(vars) > 0 { return fmt.Sprintf(translated, vars...) diff --git a/worker/mails/mail_test.go b/worker/mails/mail_test.go index e2516eb3e0e..10dc7f5e6c7 100644 --- a/worker/mails/mail_test.go +++ b/worker/mails/mail_test.go @@ -338,10 +338,10 @@ func mailServer(t *testing.T, serverString string, clientStrings []string, expec readdata := false readhead := false for i := 0; i < len(data) && data[i] != ""; i++ { - _ = tc.PrintfLine(data[i]) + _ = tc.PrintfLine("%s", data[i]) for len(data[i]) >= 4 && data[i][3] == '-' { i++ - _ = tc.PrintfLine(data[i]) + _ = tc.PrintfLine("%s", data[i]) } if data[i] == "221 Goodbye" { return