From 8a88ac761757b3617107aaf48e043446af4f381e Mon Sep 17 00:00:00 2001 From: vyasgun Date: Tue, 13 Aug 2024 14:10:16 +0530 Subject: [PATCH] Fix: go-lint fixes for go tools 0.24.0 update Related PR: https://github.com/crc-org/crc/pull/4316 --- cmd/crc/cmd/root.go | 4 ++-- pkg/crc/input/input.go | 2 +- pkg/crc/preflight/preflight.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/crc/cmd/root.go b/cmd/crc/cmd/root.go index d66f2dc724..f9da1e9c50 100644 --- a/cmd/crc/cmd/root.go +++ b/cmd/crc/cmd/root.go @@ -81,7 +81,7 @@ func runPrerun(cmd *cobra.Command) error { logging.InitLogrus(logFile) for _, str := range defaultVersion().lines() { - logging.Debugf(str) + logging.Debugf("%s", str) } return nil } @@ -138,7 +138,7 @@ func setProxyDefaults() error { } if proxyConfig.IsEnabled() { - logging.Debugf(proxyConfig.String()) + logging.Debugf("%s", proxyConfig.String()) proxyConfig.ApplyToEnvironment() } return nil diff --git a/pkg/crc/input/input.go b/pkg/crc/input/input.go index 1046123d96..82d8fd46b1 100644 --- a/pkg/crc/input/input.go +++ b/pkg/crc/input/input.go @@ -15,7 +15,7 @@ func PromptUserForYesOrNo(message string, force bool) bool { return false } var response string - fmt.Printf(message + "? [y/N]: ") + fmt.Printf("%s? [y/N]: ", message) _, _ = fmt.Scanf("%s", &response) return strings.ToLower(response) == "y" diff --git a/pkg/crc/preflight/preflight.go b/pkg/crc/preflight/preflight.go index 26163893d1..fb729e9dd8 100644 --- a/pkg/crc/preflight/preflight.go +++ b/pkg/crc/preflight/preflight.go @@ -72,7 +72,7 @@ func (check *Check) doFix() error { panic(fmt.Sprintf("Should not happen, empty description for fix '%s'", check.configKeySuffix)) } if check.flags&NoFix == NoFix { - return fmt.Errorf(check.fixDescription) + return fmt.Errorf("%s", check.fixDescription) } logging.Infof("%s", check.fixDescription)