diff options
author | Oleksandr Redko <oleksandr.red+github@gmail.com> | 2023-02-10 15:34:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-10 21:34:49 +0800 |
commit | f84e2346ba6209d0527234bd38d736d2bf5052c0 (patch) | |
tree | 089fe472a2980d3e7274f581c0c29979a2c3c8de /client.go | |
parent | Add missing fasthttp prefix in example usage (#1487) (diff) | |
download | fasthttp-f84e2346ba6209d0527234bd38d736d2bf5052c0.tar.gz fasthttp-f84e2346ba6209d0527234bd38d736d2bf5052c0.tar.bz2 fasthttp-f84e2346ba6209d0527234bd38d736d2bf5052c0.zip |
Rename unexported funcs, vars to match common Go (#1488)
See https://github.com/golang/go/wiki/CodeReviewComments#initialisms
and https://go.dev/doc/effective_go#mixed-caps
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -470,9 +470,9 @@ func (c *Client) Do(req *Request, resp *Response) error { host := uri.Host() isTLS := false - if uri.isHttps() { + if uri.isHTTPS() { isTLS = true - } else if !uri.isHttp() { + } else if !uri.isHTTP() { return fmt.Errorf("unsupported protocol %q. http and https are supported", uri.Scheme()) } @@ -1308,7 +1308,7 @@ func (c *HostClient) doNonNilReqResp(req *Request, resp *Response) (bool, error) req.secureErrorLogMessage = c.SecureErrorLogMessage req.Header.secureErrorLogMessage = c.SecureErrorLogMessage - if c.IsTLS != req.URI().isHttps() { + if c.IsTLS != req.URI().isHTTPS() { return false, ErrHostClientRedirectToDifferentScheme } @@ -2003,11 +2003,11 @@ func AddMissingPort(addr string, isTLS bool) string { return addr } - isIp6 := addr[0] == '[' - if isIp6 { + isIP6 := addr[0] == '[' + if isIP6 { // if the IPv6 has opening bracket but closing bracket is the last char then it doesn't have a port - isIp6WithoutPort := addr[addrLen-1] == ']' - if !isIp6WithoutPort { + isIP6WithoutPort := addr[addrLen-1] == ']' + if !isIP6WithoutPort { return addr } } else { // IPv4 |