misc: fixed lint warnings

This commit is contained in:
Jarek Kowalski
2018-11-03 11:54:35 -07:00
parent 9c81f6f179
commit 111a627730
3 changed files with 3 additions and 6 deletions

View File

@@ -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

View File

@@ -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))

View File

@@ -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 {