Skip to content

net/http: connReader.handleReadError doesn't use its error parameter #24201

@mvdan

Description

@mvdan

This is the case since the func was added in October 2016, as it hasn't been touched since:

func (cr *connReader) handleReadError(err error) {
       cr.conn.cancelCtx()
       cr.closeNotify()
}

Should the func not receive the parameter, or make use of it?

I found this with a static analysis tool - I don't necessarily think this is a bug. I simply agree with the tool that the code is a bit suspicious.

/cc @bradfitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions