Commit 3ed6e830 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

mime: fix docs for WordDecoder.Decode

It was correct for an early version of the CL which introduced the
type, but later versions of the CL changed the behavior without
updating the documentation.

Fixes #12568

Change-Id: Ia4090a02ba122e9f8317ed86c4c9839ae2c539e0
Reviewed-on: https://go-review.googlesource.com/14496Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 7d48573d
......@@ -98,8 +98,7 @@ type WordDecoder struct {
CharsetReader func(charset string, input io.Reader) (io.Reader, error)
}
// Decode decodes an encoded-word. If word is not a valid RFC 2047 encoded-word,
// word is returned unchanged.
// Decode decodes an RFC 2047 encoded-word.
func (d *WordDecoder) Decode(word string) (string, error) {
fields := strings.Split(word, "?") // TODO: remove allocation?
if len(fields) != 5 || fields[0] != "=" || fields[4] != "=" || len(fields[2]) != 1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment