io: NopCloser should panic if passed a nil Reader #33409
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Not sure if this is worth fixing, but thought I should create an issue in case anyone else experience the same issue.
What did you do?
If you create a new http.Request, feed it a ioutil.NopCloser with a nil reader and try to send the request using a http.Client, you'll get a panic with a stack trace from another thread.
What did you expect to see?
ioutil.NopCloser(nil) should return nil
OR
c.Do(req) should panic with stack trace leading back to this call
OR
ioutil.NopCloser(nil) should panic with stack trace leading back to this call
What did you see instead?
Panic from an internal go routine created the http package.
Does this issue reproduce with the latest release (go1.12.7)?
Yes. (tested 1.12.6 and 1.12.7)
System details
The text was updated successfully, but these errors were encountered: