Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Jun 25, 2022
1 parent 02d5900 commit c48a520
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions br/pkg/storage/azblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ func (s *AzureBlobStorage) WriteFile(ctx context.Context, name string, data []by
if err != nil {
return errors.Annotatef(err, "Failed to write azure blob file, file info: bucket(container)='%s', key='%s'", s.options.Bucket, s.withPrefix(name))
}
//nolint: errcheck
defer resp.Body.Close()
return nil
}
Expand All @@ -283,6 +284,7 @@ func (s *AzureBlobStorage) ReadFile(ctx context.Context, name string) ([]byte, e
if err != nil {
return nil, errors.Annotatef(err, "Failed to download azure blob file, file info: bucket(container)='%s', key='%s'", s.options.Bucket, s.withPrefix(name))
}
//nolint: errcheck
defer resp.RawResponse.Body.Close()
data, err := io.ReadAll(resp.Body(azblob.RetryReaderOptions{}))
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions br/pkg/storage/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (s *gcsStorage) ReadFile(ctx context.Context, name string) ([]byte, error)
"failed to read gcs file, file info: input.bucket='%s', input.key='%s'",
s.gcs.Bucket, object)
}
//nolint: errcheck
defer rc.Close()

size := rc.Attrs.Size
Expand Down
1 change: 1 addition & 0 deletions br/pkg/storage/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func (u *bufferedWriter) Write(ctx context.Context, p []byte) (int, error) {
continue
}
}
//nolint: errcheck
u.buf.Flush()
err := u.uploadChunk(ctx)
if err != nil {
Expand Down

0 comments on commit c48a520

Please sign in to comment.