slices: more explicit doc for Delete, DeleteFunc, Replace #64329
Labels
Documentation
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
This a minor documentation proposal.
I've witnessed many variations of these two incorrect idioms:
Delete does operate in-place, but because of the nature of slice headers, it also returns a new slice header. This API is similar to
append
.The documentation for functions Delete, DeleteFunc, Replace are already correct. But depending on how the user understands the words "remove" and "modified", they may still end up using one of the incorrect idioms, relying on the wrong assumption that the API must be either 100% in-place or 100% by copy.
Here is (in bold) my suggested addition to the docs:
func Delete
func DeleteFunc
func Replace
The text was updated successfully, but these errors were encountered: