Skip to content

Commit

Permalink
fixup! fixup! Add RemotePersister
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Jan 31, 2024
1 parent 7a2e7d0 commit 766d2e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/file_persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (r *RemoteFilePersister) Persist(ctx context.Context, path string, data io.
}
defer resp.Body.Close() //nolint:errcheck

if _, cerr := io.Copy(io.Discard, resp.Body); cerr != nil && err == nil {
err = fmt.Errorf("draining upload response body: %w", cerr)
if _, err := io.Copy(io.Discard, resp.Body); err != nil {
return fmt.Errorf("draining upload response body: %w", err)
}

if err := checkStatusCode(resp); err != nil {
Expand Down

0 comments on commit 766d2e8

Please sign in to comment.