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: duplicated code of resolution of hosts in `internetAddrList` #20767

Closed
AlmogBaku opened this issue Jun 23, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@AlmogBaku
Copy link

commented Jun 23, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

master

What did you do?

Resolver. internetAddrList() trying first to resolve the host as IPv4 then as IPv6 and only then to parse it with Resolver. LookupIPAddr(). Although, that's exactly what Resolver. LookupIPAddr() do anyway.

if ip := parseIPv4(host); ip != nil {

What did you expect to see?

Resolver. internetAddrList() should reuse the code by resolving the host only by Resolver. LookupIPAddr()

@AlmogBaku AlmogBaku changed the title Duplication of lookup for hosts Duplicated code of resolution of hosts in `internetAddrList` Jun 23, 2017

@bradfitz bradfitz changed the title Duplicated code of resolution of hosts in `internetAddrList` net: duplicated code of resolution of hosts in `internetAddrList` Jun 23, 2017

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jun 23, 2017

/cc @mikioh

@bradfitz bradfitz added this to the Go1.10 milestone Jun 23, 2017

@mikioh

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2017

I think it's fine to consolidate the code with the fix for #20790.

@mikioh mikioh modified the milestones: Go1.10, Unplanned Nov 25, 2017

@mikioh mikioh added the help wanted label Nov 25, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Nov 26, 2017

Change https://golang.org/cl/79935 mentions this issue: net: Parse IPv6 address with zone using DefaultResolver.Lookup{Host,IPAddr}

@mikioh mikioh modified the milestones: Unplanned, Go1.11 Nov 29, 2017

@gopherbot gopherbot closed this in d144dd7 Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.