-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Open
Labels
topic/code-lintingtype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.
Description
It's bad practive to write functions in go that return no result but also no error, e.g. return value nil, nil because it leaves the reader confused as developers are used to the fact that if there is no error, then the return value is valid.
The nilnil linter can detect such scenarios and we should enable it.
The challenge with this is that there are many violations in the current code base. When I run with the strictest config, there are currently 287 violations.
nilnil:
only-two: false
detect-opposite: trueMaybe we could add the linter and // nolint:nilnil all places so that these can be gradually refactored.
Metadata
Metadata
Assignees
Labels
topic/code-lintingtype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.