Skip to content

net/http: interface-like Transport.Dial being deprecated in favor of concrete *net.Dialer Transport.Dialer #15748

@danp

Description

@danp

In 5855905 the interface-like Transport.Dial was deprecated for a new Transport.Dialer which is a concrete *net.Dialer.

I understand Transport.Dial will remain but as seen in #12737 and #14221 it might be preferable in the long run to use something interface-based. Only DialContext is used on the new Transport.Dialer.

Before this goes out in 1.7 would it be worthwhile to change from a concrete *net.Dialer to either:

  • having Transport.Dialer be interface { DialContext(ctx context.Context, network, addr string) }
  • keeping only Transport.Dial but using DialContext on it if it implements the above interface?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions