x/website: Add section to generics docs about common type properties that can't be captured with constraints #52497
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
website
Milestone
When creating a generic data structure such as a
Set[T comparable]
, it's also important to think about such properties as:nil
interface values)==
reflexive?" - for example float64NaN
values need special handlingThese properties (and there are probably more) must be handled to avoid subtle errors in generic code, yet are also easy to overlook for beginners to generic programming like myself.
Would you consider adding a list of these properties to https://go.dev/doc/tutorial/generics or maybe https://go.dev/blog/when-generics (the two posts that have helped me the most with generics) or accepting a CL to add it?
Special thanks to @bcmills who brought this list up to me in the #generics Slack channel . I'm attaching a screenshot of our Slack conversation so it doesn't get lost in Slack history.
The text was updated successfully, but these errors were encountered: