Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/textproto: unclear statement about ReadContinuedLine #32493

Open
pam4 opened this issue Jun 8, 2019 · 1 comment
Open

net/textproto: unclear statement about ReadContinuedLine #32493

pam4 opened this issue Jun 8, 2019 · 1 comment

Comments

@pam4
Copy link

@pam4 pam4 commented Jun 8, 2019

From the documentation:

A line consisting of only white space is never continued.

I can't make sense of the above statement.

var txt string
txt += "A \n" // line 1
txt += "  \n" // line 2
txt += " B\n" // line 3
tp := textproto.NewReader(bufio.NewReader(strings.NewReader(txt)))
s, err := tp.ReadContinuedLine()
fmt.Printf("%q %v\n", s, err)

Prints "A  B" <nil> (https://play.golang.org/p/Bsrs8-5bAft).

Line 2 consists of only white space but it is "continued" (as it should be, I think).
I propose to clarify or remove the statement in question.

EDIT: It should probably read: "An empty line is never continued".

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 10, 2019

Change https://golang.org/cl/185542 mentions this issue: net/textproto: corrected documentation of empty line handling

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.