aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorGravatar Oleksandr Redko <Oleksandr_Redko@epam.com> 2023-12-05 20:49:41 +0200
committerGravatar GitHub <noreply@github.com> 2023-12-05 19:49:41 +0100
commit12949de784e688451205333ebaf87ec0ca16927d (patch)
tree66982ac74e3eefbb2137a24d4889a6d682433e36 /client.go
parentwriteBodyFixedSize: Only do an early flush if the reader is an *os.File (#1674) (diff)
downloadfasthttp-12949de784e688451205333ebaf87ec0ca16927d.tar.gz
fasthttp-12949de784e688451205333ebaf87ec0ca16927d.tar.bz2
fasthttp-12949de784e688451205333ebaf87ec0ca16927d.zip
chore: Set max line length to 130 characters (#1676)
Diffstat (limited to 'client.go')
-rw-r--r--client.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/client.go b/client.go
index 0bfc272..f12fea6 100644
--- a/client.go
+++ b/client.go
@@ -1047,7 +1047,8 @@ var (
ErrTooManyRedirects = errors.New("too many redirects detected when doing the request")
// HostClients are only able to follow redirects to the same protocol.
- ErrHostClientRedirectToDifferentScheme = errors.New("HostClient can't follow redirects to a different protocol, please use Client instead")
+ ErrHostClientRedirectToDifferentScheme = errors.New("HostClient can't follow redirects to a different protocol," +
+ " please use Client instead")
)
const defaultMaxRedirectsCount = 16
@@ -1069,7 +1070,9 @@ func doRequestFollowRedirectsBuffer(req *Request, dst []byte, url string, c clie
return statusCode, body, err
}
-func doRequestFollowRedirects(req *Request, resp *Response, url string, maxRedirectsCount int, c clientDoer) (statusCode int, body []byte, err error) {
+func doRequestFollowRedirects(
+ req *Request, resp *Response, url string, maxRedirectsCount int, c clientDoer,
+) (statusCode int, body []byte, err error) {
redirectsCount := 0
for {
@@ -1939,7 +1942,10 @@ func tlsClientHandshake(rawConn net.Conn, tlsConfig *tls.Config, deadline time.T
return conn, nil
}
-func dialAddr(addr string, dial DialFunc, dialWithTimeout DialFuncWithTimeout, dialDualStack, isTLS bool, tlsConfig *tls.Config, dialTimeout, writeTimeout time.Duration) (net.Conn, error) {
+func dialAddr(
+ addr string, dial DialFunc, dialWithTimeout DialFuncWithTimeout, dialDualStack, isTLS bool,
+ tlsConfig *tls.Config, dialTimeout, writeTimeout time.Duration,
+) (net.Conn, error) {
deadline := time.Now().Add(writeTimeout)
conn, err := callDialFunc(addr, dial, dialWithTimeout, dialDualStack, isTLS, dialTimeout)
if err != nil {
@@ -1962,7 +1968,9 @@ func dialAddr(addr string, dial DialFunc, dialWithTimeout DialFuncWithTimeout, d
return conn, nil
}
-func callDialFunc(addr string, dial DialFunc, dialWithTimeout DialFuncWithTimeout, dialDualStack, isTLS bool, timeout time.Duration) (net.Conn, error) {
+func callDialFunc(
+ addr string, dial DialFunc, dialWithTimeout DialFuncWithTimeout, dialDualStack, isTLS bool, timeout time.Duration,
+) (net.Conn, error) {
if dialWithTimeout != nil {
return dialWithTimeout(addr, timeout)
}