lint: fix unhandled errors

This commit is contained in:
Ondřej Budai 2020-02-28 23:00:46 +01:00 committed by Tom Gundersen
parent 9bef739621
commit d7cbc22da4
12 changed files with 151 additions and 56 deletions

View file

@ -109,10 +109,13 @@ func TestAWS_S3Upload(t *testing.T) {
// Delete the object from S3 after the test is finished
defer func() {
s := s3.New(sess)
s.DeleteObject(&s3.DeleteObjectInput{
_, err := s.DeleteObject(&s3.DeleteObjectInput{
Bucket: &bucket,
Key: &s3Key,
})
if err != nil {
panic(err)
}
}()
// Set up temporary file for downloaded

View file

@ -59,10 +59,11 @@ func TestAzure_FileUpload(t *testing.T) {
handleErrors(t, err)
h := md5.New()
io.Copy(h, f)
_, err = io.Copy(h, f)
handleErrors(t, err)
imageChecksum := h.Sum(nil)
f.Close()
err = f.Close()
handleErrors(t, err)
credentials := Credentials{
StorageAccount: storageAccount,
@ -99,7 +100,8 @@ func TestAzure_FileUpload(t *testing.T) {
handleErrors(t, err)
blobData := &bytes.Buffer{}
reader := get.Body(azblob.RetryReaderOptions{})
blobData.ReadFrom(reader)
_, err = blobData.ReadFrom(reader)
handleErrors(t, err)
reader.Close() // The client must close the response body when finished with it
blobBytes := blobData.Bytes()
blobChecksum := md5.Sum(blobBytes)