Skip to content

Commit

Permalink
all: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Jan 10, 2024
1 parent 91cc3f0 commit 329e3e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/bootstrap/bootstrap.go
Expand Up @@ -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...)
}
}
6 changes: 4 additions & 2 deletions upstream/resolver.go
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 329e3e3

Please sign in to comment.