]> Cypherpunks repositories - gostls13.git/commitdiff
mime: fix docs for WordDecoder.Decode
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 Sep 2015 21:16:41 +0000 (14:16 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 Sep 2015 21:50:17 +0000 (21:50 +0000)
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/14496
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/mime/encodedword.go

index 9796f506dc28c31c98ad30e26f6c07f84c952b08..ebf6164bb6fce333f41ba1637827493057b68157 100644 (file)
@@ -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 {