зеркало из https://github.com/github/s3gof3r.git
deleteMultiple(): don't lose `resp.Body.Close()` errors
Since this function doesn't used a named parameter for its `error` result, `checkClose()` would just lose any errors. Instead, call `resp.Body.Close()` inline where it is needed.
This commit is contained in:
Родитель
5e81bc116f
Коммит
b6e522f8fc
|
@ -83,11 +83,15 @@ func deleteMultiple(c *Config, b *Bucket, quiet bool, keys []string) (DeleteResu
|
|||
if resp.StatusCode != 200 {
|
||||
return DeleteResult{}, newRespError(resp)
|
||||
}
|
||||
defer checkClose(resp.Body, err)
|
||||
|
||||
var result DeleteResult
|
||||
decoder := xml.NewDecoder(resp.Body)
|
||||
if err := decoder.Decode(&result); err != nil {
|
||||
_ = resp.Body.Close()
|
||||
return DeleteResult{}, err
|
||||
}
|
||||
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
return DeleteResult{}, err
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче