Skip to content

Commit

Permalink
Update errors.Wrap to fmt.Errorf
Browse files Browse the repository at this point in the history
Signed-off-by: Clarence "Sparr" Risher <clrnc@amazon.com>
  • Loading branch information
sparr authored and Kern-- committed Jul 17, 2023
1 parent 86760b6 commit 8f01b2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/remote/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import (
rhttp "github.com/hashicorp/go-retryablehttp"
digest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
)

const (
Expand Down Expand Up @@ -336,13 +335,13 @@ func getLayerSize(ctx context.Context, hf *httpFetcher) (int64, error) {
// HEAD request (2020).
req, err = http.NewRequestWithContext(ctx, "GET", hf.url, nil)
if err != nil {
return 0, errors.Wrapf(err, "failed to make request to the registry")
return 0, fmt.Errorf("failed to make request to the registry: %w", err)
}
req.Close = false
req.Header.Set("Range", "bytes=0-1")
res, err = hf.tr.RoundTrip(req)
if err != nil {
return 0, errors.Wrapf(err, "failed to request")
return 0, fmt.Errorf("failed to request: %w", err)
}
defer func() {
io.Copy(io.Discard, res.Body)
Expand Down

0 comments on commit 8f01b2e

Please sign in to comment.