golang/go

net: Resolver.LookupIP: document should clarify the return values

Open

#43,506 opened on Jan 5, 2021

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
DocumentationNeedsFixhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

The current document on net.Resolver.LookupIP was not clear on the return values (i.e. what to expect when err is nil).

Looking into the source code, LookupIP uses internetAddrList here, and the comment for internetAddrList here does state the slice would contain at least one IP when err is nil.

We should duplicate the comment of internetAddrList to LookupIP.

Contributor guide