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

mime/quotedprintable: return a *Reader, not *io.Reader #10472

bradfitz opened this issue Apr 15, 2015 · 2 comments

mime/quotedprintable: return a *Reader, not *io.Reader #10472

bradfitz opened this issue Apr 15, 2015 · 2 comments


Copy link
Contributor is a new package for Go 1.5

It adds two function:

func NewWriter(w io.Writer) *Writer
func NewReader(r io.Reader) io.Reader

Before we lock this API down, we should change NewReader to also return a concrete type, so we have a place to put future options & methods, just like *Writer. Otherwise we're locked in. (we've been here before)

/cc @alexcesaro

@bradfitz bradfitz self-assigned this Apr 15, 2015
@bradfitz bradfitz added this to the Go1.5 milestone Apr 15, 2015
Copy link

Right, I will do it today.

There is also a very small bug in the Reader., error messages are sometimes a bit imprecise. See this test.
Currently is the output of the current code and mime/qp is the output of a slightly different algorithm I had done. The code is longer but is a bit faster:

CurrentDecode      100000         19591 ns/op        4273 B/op           4 allocs/op
NewDecode          100000         15850 ns/op        4289 B/op           4 allocs/op

Do you think that is worth doing another CL on the reader?

Copy link
Contributor Author

If I read your comment correctly, you mention three issues:

  1. Changing return from io.Reader to *Reader
  2. Better error messages
  3. Better performance

I think all three can be separate CLs. But number 1 is most important and should happen first.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants