You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your feature request related to a problem? Please describe.
The problem is well described in Go FAQ. It is often surprising that comparing a typed interface nil to nil is not true.
Describe the solution you'd like.
I would like to propose to make a linter which warns if a function is returning a typed nil.
Describe alternatives you've considered.
There were many potential solutions proposed for Go 2 to address that, but it looks like it is hard to find a backward compatible solution here. But on the other hand, having a typed nil on purpose is a very rare case and something which might be a reasonable false positive for a linter.
Additional context.
No response
The text was updated successfully, but these errors were encountered:
@ldez That proposal (at its past and current iteration) does not address the issue this issue is about, because zero can be used only where nil cannot be used. And this issue is about (typed) nil.
Your feature request related to a problem? Please describe.
The problem is well described in Go FAQ. It is often surprising that comparing a typed interface nil to nil is not true.
Describe the solution you'd like.
I would like to propose to make a linter which warns if a function is returning a typed nil.
Describe alternatives you've considered.
There were many potential solutions proposed for Go 2 to address that, but it looks like it is hard to find a backward compatible solution here. But on the other hand, having a typed nil on purpose is a very rare case and something which might be a reasonable false positive for a linter.
Additional context.
No response
The text was updated successfully, but these errors were encountered: