From f43fbd557a3c2e2e322d2c4ff15acfd0447ac30b Mon Sep 17 00:00:00 2001
From: Nir Soffer <nsoffer@redhat.com>
Date: Sat, 18 May 2024 17:44:56 +0300
Subject: [PATCH] Add stylecheck linter, replacement for golint

This revealed 2 capitalized error messages.

https://golangci-lint.run/usage/linters/#stylecheck
---
 .golangci.yml  | 2 +-
 command.go     | 2 +-
 completions.go | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.golangci.yml b/.golangci.yml
index 2c3562ac..7b6d3021 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -49,7 +49,7 @@ linters:
     #- scopelint
     #- staticcheck
     #- structcheck ! deprecated since v1.49.0; replaced by 'unused'
-    #- stylecheck
+    - stylecheck
     #- typecheck
     - unconvert
     #- unparam
diff --git a/command.go b/command.go
index b6f8f4b1..b31e22c8 100644
--- a/command.go
+++ b/command.go
@@ -875,7 +875,7 @@ func (c *Command) ArgsLenAtDash() int {
 
 func (c *Command) execute(a []string) (err error) {
 	if c == nil {
-		return fmt.Errorf("Called Execute() on a nil Command")
+		return fmt.Errorf("called Execute() on a nil Command")
 	}
 
 	if len(c.Deprecated) > 0 {
diff --git a/completions.go b/completions.go
index ad7b6d0a..c0c08b05 100644
--- a/completions.go
+++ b/completions.go
@@ -298,7 +298,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
 	}
 	if err != nil {
 		// Unable to find the real command. E.g., <program> someInvalidCmd <TAB>
-		return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs)
+		return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs)
 	}
 	finalCmd.ctx = c.ctx