Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
uploader: Update errors check
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <[email protected]>
  • Loading branch information
smallhive committed Aug 11, 2023
1 parent 52e169f commit 50b36c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uploader/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package uploader
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -233,7 +234,7 @@ func (u *Uploader) Upload(c *fasthttp.RequestCtx) {
// pipelined header. Thus we need to drain the body buffer.
for {
_, err = bodyStream.Read(drainBuf)
if err == io.EOF || err == io.ErrUnexpectedEOF {
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) {

Check warning on line 237 in uploader/upload.go

View check run for this annotation

Codecov / codecov/patch

uploader/upload.go#L237

Added line #L237 was not covered by tests
break
}
}
Expand Down

0 comments on commit 50b36c6

Please sign in to comment.