-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proposal: io: add RuneWriter
interface
#71027
Comments
Related Issues Related Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
What do we gain from being prescriptive about UTF8 ? |
I don't have a good answer for that, but in my use case, i am checking whether an |
If there's an |
FWIW currently we don't have a |
I think the argument against
|
I wonder whether we want to import |
Although it's not exactly the same, this proposal made me think of Specifically, All of that is to say that I agree with the commentary above that this interface ought not to require that all implementers produce UTF-8. A specific implementation of this interface could decide to use UTF-8 as its output format. |
Proposal Details
Today i was surprised that
io
does not define aRuneWriter
interface, it think that we should add one, considering that it is implemented by types in the std, also we already have aio.RuneReader
interface andio.ByteWriter
/io.ByteReader
.(*strings.Builder).WriteRune
(*bytes.Buffer).WriteRune
(*bufio.Writer).WriteRune
Proposed API:
The text was updated successfully, but these errors were encountered: