-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: docs do not always state that UTF-8 encoding is used #21950
Comments
I do see that many of the function doc comments do explicitly say "UTF-8-encoded". It doesn't really seem necessary to me, but I guess it might be reasonable to say that a few more places. |
The package documentation for the strings packages says, "Package strings implements simple functions to manipulate UTF-8 encoded strings." Adding that information to every function in the package is unnecessary. On the other hand, the bytes package makes no such sweeping claim, so for the functions where that is an issue, such as ContainsRune, it would indeed be reasonable to add the information although I believe context does make it unnecessary. Go is a UTF-8 language. |
@robpike The example below |
Change https://golang.org/cl/66750 mentions this issue: |
Not all functions in the bytes package that operate on strings and runes specify that UTF-8 encoding is used. From an initial glance, it appears the following functions are missing that information from their documentation:
Does it make sense to include that detail in each of the above functions?
The text was updated successfully, but these errors were encountered: