From f68ce30f261eb8328aaf8115291ccd7da0b32f53 Mon Sep 17 00:00:00 2001 From: Gaius Date: Tue, 5 Jul 2022 14:52:58 +0800 Subject: [PATCH] feat: remove errors package (#1434) Signed-off-by: Gaius --- go.mod | 2 +- pkg/source/clients/httpprotocol/http_source_client.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d8b8b2ab1..6e4c3de33 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,6 @@ require ( github.com/onsi/gomega v1.19.0 github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 github.com/prometheus/client_golang v1.12.2 - github.com/prometheus/common v0.35.0 github.com/schollz/progressbar/v3 v3.8.6 github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b github.com/shirou/gopsutil/v3 v3.22.5 @@ -168,6 +167,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.35.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect diff --git a/pkg/source/clients/httpprotocol/http_source_client.go b/pkg/source/clients/httpprotocol/http_source_client.go index 311f46a3e..1e8806522 100644 --- a/pkg/source/clients/httpprotocol/http_source_client.go +++ b/pkg/source/clients/httpprotocol/http_source_client.go @@ -29,7 +29,6 @@ import ( "time" "github.com/go-http-utils/headers" - "github.com/pkg/errors" "d7y.io/dragonfly/v2/pkg/source" ) @@ -190,7 +189,7 @@ func (client *httpSourceClient) GetMetadata(request *source.Request) (*source.Me if length != "*" { totalContentLength, err = strconv.ParseInt(length, 10, 64) if err != nil { - return nil, errors.Wrapf(err, "convert length from string %q error", length) + return nil, fmt.Errorf("convert length from string %q error: %w", length, err) } } }