mirror of
https://github.com/golang/go
synced 2024-11-24 05:40:15 -07:00
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/14496 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
7d48573d46
commit
3ed6e830b9
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user