mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
Fix lint issues reported by staticcheck
Used staticcheck 2022.1.2 (v0.3.2) See: staticcheck.io
This commit is contained in:
@@ -136,7 +136,7 @@ func (g *GetFileLinkResult) IsValid() bool {
|
||||
if len(g.Hosts) == 0 {
|
||||
return false
|
||||
}
|
||||
return time.Time(g.Expires).Sub(time.Now()) > 30*time.Second
|
||||
return time.Until(time.Time(g.Expires)) > 30*time.Second
|
||||
}
|
||||
|
||||
// URL returns a URL from the Path and Hosts. Check with IsValid
|
||||
|
||||
@@ -227,7 +227,7 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, err
|
||||
}
|
||||
}
|
||||
|
||||
if resp != nil && resp.StatusCode == 401 && len(resp.Header["Www-Authenticate"]) == 1 && strings.Index(resp.Header["Www-Authenticate"][0], "expired_token") >= 0 {
|
||||
if resp != nil && resp.StatusCode == 401 && len(resp.Header["Www-Authenticate"]) == 1 && strings.Contains(resp.Header["Www-Authenticate"][0], "expired_token") {
|
||||
doRetry = true
|
||||
fs.Debugf(nil, "Should retry: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user