Skip to content

Commit

Permalink
docs: fix example for ErrDialWithUpstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Denushev committed May 2, 2024
1 parent 432e795 commit e38d6f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tcpdialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,12 @@ var ErrDialTimeout = errors.New("dialing to the given TCP address timed out")
//
// Should use errors.As to get upstream information from error:
//
// var dialErr *fasthttp.ErrDialWithUpstream
// hc := fasthttp.HostClient{Addr: "foo.com,bar.com"}
// err := hc.Do(req, res)
//
// var dialErr *fasthttp.ErrDialWithUpstream
// if errors.As(err, &dialErr) {
// upstream = dialErr.Upstream
// upstream = dialErr.Upstream // 34.206.39.153:80
// }
type ErrDialWithUpstream struct {
Upstream string
Expand Down

0 comments on commit e38d6f1

Please sign in to comment.