From 54f39c7da5c61daeedda50a6edf0bbd448cd99f7 Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:21:28 +0200 Subject: [PATCH] replace github.com/juju/errors with github.com/pkg/errors wich is used in the rest of the project and does not have a LGPL license Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- go.mod | 1 - go.sum | 2 -- pkg/client/client_oauth.go | 10 +++++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 39681769..e20deed3 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/jetstack/venafi-connection-lib v0.1.1-0.20240814101135-a72cec54dc1a github.com/json-iterator/go v1.1.12 - github.com/juju/errors v1.0.0 github.com/kylelemons/godebug v1.1.0 github.com/maxatome/go-testdeep v1.14.0 github.com/microcosm-cc/bluemonday v1.0.26 diff --git a/go.sum b/go.sum index 3f77ffc7..88954226 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,6 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/juju/errors v1.0.0 h1:yiq7kjCLll1BiaRuNY53MGI0+EQ3rF6GB+wvboZDefM= -github.com/juju/errors v1.0.0/go.mod h1:B5x9thDqx0wIMH3+aLIMP9HjItInYWObRovoCFM5Qe8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/pkg/client/client_oauth.go b/pkg/client/client_oauth.go index b5238e3b..310a51b8 100644 --- a/pkg/client/client_oauth.go +++ b/pkg/client/client_oauth.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/go-multierror" "github.com/jetstack/preflight/api" - "github.com/juju/errors" + "github.com/pkg/errors" ) type ( @@ -178,18 +178,18 @@ func (c *OAuthClient) renewAccessToken() error { payload.Set("password", c.credentials.UserSecret) req, err := http.NewRequest("POST", tokenURL, strings.NewReader(payload.Encode())) if err != nil { - return errors.Trace(err) + return errors.WithStack(err) } req.Header.Add("content-type", "application/x-www-form-urlencoded") res, err := http.DefaultClient.Do(req) if err != nil { - return errors.Trace(err) + return errors.WithStack(err) } body, err := ioutil.ReadAll(res.Body) if err != nil { - return errors.Trace(err) + return errors.WithStack(err) } defer res.Body.Close() @@ -205,7 +205,7 @@ func (c *OAuthClient) renewAccessToken() error { err = json.Unmarshal(body, &response) if err != nil { - return errors.Trace(err) + return errors.WithStack(err) } if response.ExpiresIn == 0 {