Skip to content

Commit

Permalink
errcheck: empty selector name. (#2309)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Oct 25, 2021
1 parent bdc2f96 commit 413bec6
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 413bec6

Please sign in to comment.