Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bytes: articulate the doc to show results of Split() given various inputs #40490

Open
leventov opened this issue Jul 30, 2020 · 2 comments
Open

bytes: articulate the doc to show results of Split() given various inputs #40490

leventov opened this issue Jul 30, 2020 · 2 comments

Comments

@leventov
Copy link

@leventov leventov commented Jul 30, 2020

It would be nice if bytes.Split() documented whether it returns an empty slice as the first/last slice of subslices if the input starts with the separator sequence or ends with the separator sequence, and also what does bytes.Split() return given an empty input: empty slice or a slice containing a single element - an empty slice.

@odeke-em odeke-em changed the title bytes.Split(): improve the doc bytes: articulate the doc to show results of Split() given various inputs Jul 30, 2020
@odeke-em
Copy link
Member

@odeke-em odeke-em commented Jul 30, 2020

Thank you for this report @leventov!

The doc for strings contains more information and covers all the requests cases except for the one in which the separator is the first or last element https://golang.org/pkg/strings/#Split
Screen Shot 2020-07-30 at 11 26 58 AM

Kindly pinging our articulator in chief @robpike.

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jul 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants