Skip to content

Commit

Permalink
remove github.com/pkg/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws authored Oct 31, 2023
2 parents 36eab49 + 263b9cc commit e27906a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
7 changes: 3 additions & 4 deletions example/aws/credentials/plugincreds/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ package main

import (
"encoding/json"
"fmt"
"os"

"github.com/pkg/errors"
)

// Example plugin that will retrieve credentials from a JSON file that the
Expand Down Expand Up @@ -41,7 +40,7 @@ type provider struct {
func (p *provider) Retrieve() (key, secret, token string, err error) {
f, err := os.Open(p.Filename)
if err != nil {
return "", "", "", errors.Wrapf(err, "failed to open credentials file, %q", p.Filename)
return "", "", "", fmt.Errorf("failed to open credentials file, %q: %w", p.Filename, err)
}
decoder := json.NewDecoder(f)

Expand All @@ -50,7 +49,7 @@ func (p *provider) Retrieve() (key, secret, token string, err error) {
}{}

if err := decoder.Decode(&creds); err != nil {
return "", "", "", errors.Wrap(err, "failed to decode credentials file")
return "", "", "", fmt.Errorf("failed to decode credentials file: %w", err)
}

p.loaded = true
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.19

require (
github.com/jmespath/go-jmespath v0.4.0
github.com/pkg/errors v0.9.1
golang.org/x/net v0.1.0
)

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down

0 comments on commit e27906a

Please sign in to comment.