Skip to content

Commit

Permalink
refactor: fix revive.indent-error-flow lint issues (#1896)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Nov 10, 2024
1 parent f6ba4ab commit bc70d31
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ linters-settings:
revive:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
rules:
- name: indent-error-flow
- name: use-any
lll:
line-length: 130
Expand Down
3 changes: 1 addition & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3060,9 +3060,8 @@ func (t *transport) RoundTrip(hc *HostClient, req *Request, resp *Response) (ret
return nil
})
return false, nil
} else {
hc.releaseReader(br)
}
hc.releaseReader(br)

if closeConn {
hc.closeConn(cc)
Expand Down
3 changes: 1 addition & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -1590,9 +1590,8 @@ func (req *Request) Write(w *bufio.Writer) error {
if len(req.Header.Host()) == 0 {
if len(host) == 0 {
return errRequestHostRequired
} else {
req.Header.SetHostBytes(host)
}
req.Header.SetHostBytes(host)
} else if !req.UseHostHeader {
req.Header.SetHostBytes(host)
}
Expand Down
6 changes: 3 additions & 3 deletions uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ func (u *URI) parse(host, uri []byte, isTLS bool) error {
}

u.host = append(u.host, host...)
if parsedHost, err := parseHost(u.host); err != nil {
parsedHost, err := parseHost(u.host)
if err != nil {
return err
} else {
u.host = parsedHost
}
u.host = parsedHost
lowercaseBytes(u.host)

b := uri
Expand Down

0 comments on commit bc70d31

Please sign in to comment.