golang/go

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

Open

#43.506 aperta il 5 gen 2021

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationNeedsFixhelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor