Skip to content

Commit

Permalink
errcheck: empty selector name. (golangci#2309)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and SeigeC committed Apr 4, 2023
1 parent 6e12687 commit 2fff7c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/golinters/errcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ func NewErrcheck() *goanalysis.Linter {
for i, err := range errcheckIssues.UncheckedErrors {
var text string
if err.FuncName != "" {
code := err.SelectorName
if err.SelectorName == "" {
code = err.FuncName
}

text = fmt.Sprintf(
"Error return value of %s is not checked",
formatCode(err.SelectorName, lintCtx.Cfg),
formatCode(code, lintCtx.Cfg),
)
} else {
text = "Error return value is not checked"
Expand Down

0 comments on commit 2fff7c4

Please sign in to comment.