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/http: interface-like Transport.Dial being deprecated in favor of concrete *net.Dialer Transport.Dialer #15748

Closed
danp opened this issue May 19, 2016 · 9 comments

Comments

@danp
Copy link
Contributor

danp commented May 19, 2016

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?
@danp
Copy link
Contributor Author

danp commented May 19, 2016

And even while Transport.Dial remains as-is there will be no way for a non-*net.Dialer to receive context since that is only used with Transport.Dialer.

cc @bradfitz

@mikioh mikioh added this to the Go1.7 milestone May 21, 2016
@mikioh
Copy link
Contributor

mikioh commented May 21, 2016

Ping @bradfitz

@bradfitz
Copy link
Contributor

Sorry, I've been rushing to finish my Go 1.7 bugs before I disappear on vacation for a month. That month begins approximately 15 minutes ago. I'll leave this to others.

@danp
Copy link
Contributor Author

danp commented May 24, 2016

Happy to submit a CL for this if we can decide on a solution.

@mikioh mikioh modified the milestones: Go1.7Beta, Go1.7 May 25, 2016
@rsc
Copy link
Contributor

rsc commented May 27, 2016

It seems like it should be a DialContext func, to match the previous Dial func.

@danp
Copy link
Contributor Author

danp commented May 27, 2016

Sounds good, I should be able to get a CL together later today.

On Friday, 27 May 2016, Russ Cox notifications@github.com wrote:

It seems like it should be a DialContext func, to match the previous Dial
func.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#15748 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAAIhgq7hYZw513BdkG7JSuvvxZqHHgKks5qFn90gaJpZM4IiUoN
.

@rsc
Copy link
Contributor

rsc commented May 27, 2016

@dpiddy, I'm heading out soon and want to get this in, so I'll write the CL. I'll make sure you are on it. Thanks.

@gopherbot
Copy link

CL https://golang.org/cl/23489 mentions this issue.

@danp
Copy link
Contributor Author

danp commented May 27, 2016

Thanks!

@golang golang locked and limited conversation to collaborators May 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants