Skip to content

net/http: Transport.DialContext breaks existing code #16703

Closed
@rogpeppe

Description

@rogpeppe

In Go 1.7 the new http.Transport.DialContext field overrides the Dial field.
This breaks any existing code that takes the http.DefaultTransport,
sets Dial and expects network calls to be made using that value.
This did actually break some of our test code that used this functionality
to prevent accidental external network access in tests.

For better backward compatibility, perhaps it might be better to make Dial
override DialContext - existing code will continue to work unchanged
and most new code will never touch Dial, so the override isn't so important
in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.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