]> Cypherpunks repositories - gostls13.git/commit
mime/multipart: simplify Part.Read
authorRuss Cox <rsc@golang.org>
Wed, 26 Oct 2016 03:15:30 +0000 (23:15 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 28 Oct 2016 19:05:47 +0000 (19:05 +0000)
commitef3df18944d2d210f99de88fee01414ab1fa8f66
tree5f58263322e6e51d02b1e47d8928bf335ccd2f9f
parent14f3284ddb682ccf111716b50f43dc6ee072cf4c
mime/multipart: simplify Part.Read

The basic structure of Part.Read should be simple:
do what you can with the current buffered data,
reading more as you need it. Make it that way.

Working entirely in the bufio.Reader's buffer eliminates
the need for an additional bytes.Buffer.

This structure should be easier to extend in the future as
more special cases arise.

Change-Id: I83cb24a755a1767c4c037f9ece6716460c3ecd01
Reviewed-on: https://go-review.googlesource.com/32092
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/mime/multipart/multipart.go