-
Notifications
You must be signed in to change notification settings - Fork 301
Open
Labels
rule proposalIssue proposing a new ruleIssue proposing a new rule
Description
Is your feature request related to a problem? Please describe.
The code
var err error
insts, err := call()
can be simplified to
insts, err := call()
Describe the solution you'd like
A new rule redundant-err-decl
that would suggest removing redundant err
declarations.
Describe alternatives you've considered
Use sed
to search redundant for err
declarations and remove them manually:
find . -name '*.go' -exec sed -n '/var err error/{N;/\n.*err :=/p;}' {} +
Additional context
See these PRs for examples:
Metadata
Metadata
Assignees
Labels
rule proposalIssue proposing a new ruleIssue proposing a new rule