mirror of
https://github.com/kopia/kopia.git
synced 2026-04-28 01:49:27 -04:00
misc: fixed lint warnings
This commit is contained in:
@@ -21,7 +21,7 @@ func (bm *Manager) RecoverIndexFromPackFile(ctx context.Context, packFile string
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to open index in file %v", packFile)
|
||||
}
|
||||
defer ndx.Close()
|
||||
defer ndx.Close() //nolint:errcheck
|
||||
|
||||
var recovered []Info
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ func (fs *fsStorage) GetBlock(ctx context.Context, blockID string, offset, lengt
|
||||
return ioutil.ReadAll(f)
|
||||
}
|
||||
|
||||
if _, err := f.Seek(offset, io.SeekStart); err != nil {
|
||||
if _, err = f.Seek(offset, io.SeekStart); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b, err := ioutil.ReadAll(io.LimitReader(f, length))
|
||||
|
||||
@@ -72,10 +72,7 @@ func exponentialBackoff(desc string, att retry.AttemptFunc) (interface{}, error)
|
||||
|
||||
func isRetriableError(err error) bool {
|
||||
if apiError, ok := err.(*googleapi.Error); ok {
|
||||
if apiError.Code >= 500 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return apiError.Code >= 500
|
||||
}
|
||||
|
||||
switch err {
|
||||
|
||||
Reference in New Issue
Block a user