bytes: document capacity expectations of Split and Fields #47414
Labels
Documentation
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The
Split
function returns a slice of sub-slices from the original input. Presently, it does not document any expectations regarding the capacity of each individual sub-slice.For example, what's the expected behavior of the following?
Currently, it prints "bar" because the logic explicitly caps the capacity to the length, which is the behavior I would expect.
However, we should probably document that this is behavior users can depend on.
The text was updated successfully, but these errors were encountered: