apply staticcheck

This commit is contained in:
Alexandre Blazart 2022-09-30 21:11:12 +02:00
parent e224a452be
commit ab395a42c8
No known key found for this signature in database
GPG key ID: 7067AE298F0C655B
5 changed files with 16 additions and 19 deletions

View file

@ -67,7 +67,7 @@ func GetAppToken(client *FreeboxHttpClient, apiVersion *FreeboxAPIVersion) (stri
case "granted":
return postResponse.AppToken, nil
default:
return "", fmt.Errorf("Access is %s", status.Status)
return "", fmt.Errorf("access is %s", status.Status)
}
}
}
@ -110,7 +110,7 @@ func (f *FreeboxSession) Refresh() error {
f.sessionTokenLock.Lock()
defer f.sessionTokenLock.Unlock()
if sinceLastUpdate := time.Now().Sub(f.sessionTokenLastUpdate); sinceLastUpdate < 5*time.Second {
if sinceLastUpdate := time.Since(f.sessionTokenLastUpdate); sinceLastUpdate < 5*time.Second {
log.Debug.Printf("Updated %v ago. Skipping", sinceLastUpdate)
return nil
}