-
Notifications
You must be signed in to change notification settings - Fork 18k
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: Resolver.LookupIP: document should clarify the return values #43506
Comments
The function will return at least one address when error is nil. Fixes golang#43506
Change https://golang.org/cl/281552 mentions this issue: |
Why is this specific to |
It might apply to other functions as well, I only encountered this problem when using |
My point is: let's try to find a clean fix for all relevant functions and methods, rather than just fixing one location. Thanks. |
These functions always return at least one entry when err is nil. Fixes golang#43506
Change https://golang.org/cl/314989 mentions this issue: |
The current document on
net.Resolver.LookupIP
was not clear on the return values (i.e. what to expect whenerr
isnil
).Looking into the source code,
LookupIP
usesinternetAddrList
here, and the comment forinternetAddrList
here does state the slice would contain at least one IP when err is nil.We should duplicate the comment of
internetAddrList
toLookupIP
.The text was updated successfully, but these errors were encountered: