mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-08 18:23:15 -06:00
[chore] Upgrade golangci-lint, ignore existing int overflow warnings
There is a new lint for unchecked int casts. Integer overflows are bad, but the old code that triggers this lint seems to be perfectly fine. Instead of disabling the lint entirely for new code as well, grandfather in existing code.
This commit is contained in:
parent
95a316236e
commit
275a3f8636
19 changed files with 58 additions and 58 deletions
|
|
@ -340,14 +340,14 @@ func (c *Client) do(r *Request) (rsp *http.Response, retry bool, err error) {
|
|||
|
||||
if u, _ := strconv.ParseUint(after, 10, 32); u != 0 {
|
||||
// An integer no. of backoff seconds was provided.
|
||||
r.backoff = time.Duration(u) * time.Second
|
||||
r.backoff = time.Duration(u) * time.Second //nolint:gosec
|
||||
} else if at, _ := http.ParseTime(after); !at.Before(now) {
|
||||
// An HTTP formatted future date-time was provided.
|
||||
r.backoff = at.Sub(now)
|
||||
}
|
||||
|
||||
// Don't let their provided backoff exceed our max.
|
||||
if max := baseBackoff * time.Duration(c.retries); //
|
||||
if max := baseBackoff * time.Duration(c.retries); //nolint:gosec
|
||||
r.backoff > max {
|
||||
r.backoff = max
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue