Merge pull request #1846 from mmorel-35/staticcheck/ST1005

fix(ST1005): Incorrectly formatted error string
dependabot/github_actions/actions/setup-go-5.5.0
shirou 5 days ago committed by GitHub
commit 15eaecda07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -123,7 +123,6 @@ linters:
- -SA5003 # Defers in infinite loops will never execute - -SA5003 # Defers in infinite loops will never execute
- -SA9003 # Empty body in an if or else branch - -SA9003 # Empty body in an if or else branch
- -ST1003 # Poorly chosen identifier - -ST1003 # Poorly chosen identifier
- -ST1005 # Incorrectly formatted error string
testifylint: testifylint:
enable-all: true enable-all: true
usetesting: usetesting:

@ -80,7 +80,7 @@ func HostIDWithContext(_ context.Context) (string, error) {
hostID := windows.UTF16ToString(regBuf[:]) hostID := windows.UTF16ToString(regBuf[:])
hostIDLen := len(hostID) hostIDLen := len(hostID)
if hostIDLen != uuidLen { 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 return strings.ToLower(hostID), nil

@ -16,7 +16,7 @@ import (
) )
var ( var (
errNetstatHeader = errors.New("Can't parse header of netstat output") errNetstatHeader = errors.New("can't parse header of netstat output")
netstatLinkRegexp = regexp.MustCompile(`^<Link#(\d+)>$`) netstatLinkRegexp = regexp.MustCompile(`^<Link#(\d+)>$`)
) )
@ -50,7 +50,7 @@ func parseNetstatLine(line string) (stat *IOCountersStat, linkID *uint, err erro
base = 0 base = 0
} }
if numberColumns < 11 || numberColumns > 13 { 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 return //nolint:nakedret //FIXME
} }

Loading…
Cancel
Save