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
I am looking to amend the FAQ method on values or pointers as it is currently leading to confusion and resulting in warnings being added to IDEs for valid use cases.
Specifically this section:
Next is consistency. If some of the methods of the type must have pointer receivers, the rest should too, so the method set is consistent regardless of how the type is used. See the section on method sets for details.
When there are multiple valid use cases for mixed receiver types. Many developers and IDEs such as JetBrains' GoLand, view FAQs as standards, and thus issued warnings within their linter for mixed-type receivers based upon this. Not only are there confirmed valid use cases for mixed-type receivers but in some cases like the one outlined in #56939, it should even be considered a best practice for developers especially new ones to provide safety against nil pointer receivers which there is also no explicit documentation nor recommendation on.
Is it possible to clarify this within the docs / FAQs, elaborate on these valid use cases, and remove the recommendation and perceived standard of having unilateral pointer or value receivers on types?
The text was updated successfully, but these errors were encountered:
Please see #56939
I am looking to amend the FAQ method on values or pointers as it is currently leading to confusion and resulting in warnings being added to IDEs for valid use cases.
Specifically this section:
When there are multiple valid use cases for mixed receiver types. Many developers and IDEs such as JetBrains' GoLand, view FAQs as standards, and thus issued warnings within their linter for mixed-type receivers based upon this. Not only are there confirmed valid use cases for mixed-type receivers but in some cases like the one outlined in #56939, it should even be considered a best practice for developers especially new ones to provide safety against nil pointer receivers which there is also no explicit documentation nor recommendation on.
Is it possible to clarify this within the docs / FAQs, elaborate on these valid use cases, and remove the recommendation and perceived standard of having unilateral pointer or value receivers on types?
The text was updated successfully, but these errors were encountered: