Remove github.com/pkg/errors with appropriate replacements (#3172)

* errors.Wrap* removal

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* remove errors.Errorf

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Remove remaining calls

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Few more errors

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Fix golint errors

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2025-02-20 08:58:37 +05:30
committed by GitHub
parent 2fd44174ce
commit caffed92f4
113 changed files with 585 additions and 588 deletions
+4 -3
View File
@@ -28,7 +28,8 @@ import (
"os"
"strings"
"github.com/pkg/errors"
"errors"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"golang.org/x/net/context/ctxhttp"
@@ -160,7 +161,7 @@ func (c *client) Download(ctx context.Context, id string, filePath string) error
// quit if file exists
_, err := os.Stat(filePath)
if err == nil || !os.IsNotExist(err) {
return errors.Errorf("file already exists: %v", filePath)
return fmt.Errorf("file already exists: %v", filePath)
}
// create
@@ -223,7 +224,7 @@ func (c *client) Delete(ctx context.Context, id string) error {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return errors.Errorf("HTTP error %v", resp.StatusCode)
return fmt.Errorf("HTTP error %v", resp.StatusCode)
}
return nil