diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index f6f68254d..ae08de9d1 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -129,7 +129,6 @@ func NewDialContext(timeout time.Duration, addrs ...string) (h DialHandler) { return conn, nil } - // TODO(e.burkov): Use errors.Join in Go 1.20. - return nil, errors.List("all dialers failed", errs...) + return nil, errors.Join(errs...) } } diff --git a/upstream/resolver.go b/upstream/resolver.go index dd2c19beb..5f98c800d 100644 --- a/upstream/resolver.go +++ b/upstream/resolver.go @@ -205,7 +205,7 @@ func (r *UpstreamResolver) resolveIP( // resolve performs a single DNS lookup of host and returns all the valid // addresses from the answer section of the response. network must be either -// "ip4" or "ip6". +// "ip4" or "ip6". host must be in a lower-case FQDN form. // // TODO(e.burkov): Consider NS and Extra sections when setting TTL. Check out // what RFCs say about it. @@ -235,8 +235,10 @@ func (r *UpstreamResolver) resolve( }}, } + // As per [upstream.Exchange] documentation, the response is always returned + // if no error occurred. resp, err := r.Exchange(req) - if err != nil || resp == nil { + if err != nil { return nil, err }