• Russ Cox's avatar
    mime/multipart: simplify Part.Read · ef3df189
    Russ Cox authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    ef3df189
multipart.go 11.4 KB