From 71c74393f23da5c5d3b112469d96df8ec8fa24f6 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Tue, 6 May 2025 07:08:48 +0200 Subject: [PATCH] fix(ST1005): Incorrectly formatted error string Signed-off-by: Matthieu MOREL --- .golangci.yml | 1 - host/host_windows.go | 2 +- net/net_darwin.go | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d62e5bd..2c0436b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -123,7 +123,6 @@ linters: - -SA5003 # Defers in infinite loops will never execute - -SA9003 # Empty body in an if or else branch - -ST1003 # Poorly chosen identifier - - -ST1005 # Incorrectly formatted error string testifylint: enable-all: true usetesting: diff --git a/host/host_windows.go b/host/host_windows.go index 2386916..7552641 100644 --- a/host/host_windows.go +++ b/host/host_windows.go @@ -80,7 +80,7 @@ func HostIDWithContext(_ context.Context) (string, error) { hostID := windows.UTF16ToString(regBuf[:]) hostIDLen := len(hostID) if hostIDLen != uuidLen { - return "", fmt.Errorf("HostID incorrect: %q\n", hostID) //nolint:revive //FIXME + return "", fmt.Errorf("HostID incorrect: %q", hostID) } return strings.ToLower(hostID), nil diff --git a/net/net_darwin.go b/net/net_darwin.go index 5814a54..830b3e7 100644 --- a/net/net_darwin.go +++ b/net/net_darwin.go @@ -16,7 +16,7 @@ import ( ) var ( - errNetstatHeader = errors.New("Can't parse header of netstat output") + errNetstatHeader = errors.New("can't parse header of netstat output") netstatLinkRegexp = regexp.MustCompile(`^$`) ) @@ -50,7 +50,7 @@ func parseNetstatLine(line string) (stat *IOCountersStat, linkID *uint, err erro base = 0 } if numberColumns < 11 || numberColumns > 13 { - err = fmt.Errorf("Line %q do have an invalid number of columns %d", line, numberColumns) + err = fmt.Errorf("line %q do have an invalid number of columns %d", line, numberColumns) return //nolint:nakedret //FIXME }