Skip to content

Commit

Permalink
chore: drop dependency on github.com/pkg/errors (#301)
Browse files Browse the repository at this point in the history
This functionality is mostly available in the standard library (apart
from stack traces), and it makes more sense to use the standard library
equivalents rather to have a dependency.
  • Loading branch information
blgm authored Apr 19, 2024
1 parent d6903b8 commit 654f8c1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
5 changes: 2 additions & 3 deletions domain/service_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package domain

import (
"encoding/json"
"fmt"
"reflect"

"github.com/pkg/errors"
)

type ServiceMetadata struct {
Expand All @@ -23,7 +22,7 @@ func (sm ServiceMetadata) MarshalJSON() ([]byte, error) {

b, err := json.Marshal(Alias(sm))
if err != nil {
return []byte{}, errors.Wrap(err, "unmarshallable content in AdditionalMetadata")
return nil, fmt.Errorf("unmarshallable content in AdditionalMetadata: %w", err)
}

var m map[string]interface{}
Expand Down
5 changes: 2 additions & 3 deletions domain/service_plan_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package domain

import (
"encoding/json"
"fmt"
"reflect"
"strings"

"github.com/pkg/errors"
)

type ServicePlanMetadata struct {
Expand Down Expand Up @@ -51,7 +50,7 @@ func (spm ServicePlanMetadata) MarshalJSON() ([]byte, error) {

b, err := json.Marshal(Alias(spm))
if err != nil {
return []byte{}, errors.Wrap(err, "unmarshallable content in AdditionalMetadata")
return nil, fmt.Errorf("unmarshallable content in AdditionalMetadata: %w", err)
}

var m map[string]interface{}
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/onsi/ginkgo/v2 v2.17.1
github.com/onsi/gomega v1.33.0
github.com/pborman/uuid v1.2.1
github.com/pkg/errors v0.9.1
honnef.co/go/tools v0.4.7
)

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE=
github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY=
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
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/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
Expand Down
3 changes: 1 addition & 2 deletions handlers/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package handlers_test

import (
"context"
"errors"
"log/slog"
"net/http"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/pkg/errors"

"github.com/pivotal-cf/brokerapi/v11/domain"
"github.com/pivotal-cf/brokerapi/v11/domain/apiresponses"
brokerFakes "github.com/pivotal-cf/brokerapi/v11/fakes"
Expand Down
2 changes: 1 addition & 1 deletion handlers/last_binding_operation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handlers_test
import (
"context"
"encoding/json"
"errors"
"fmt"
"log/slog"
"net/http"
Expand All @@ -17,7 +18,6 @@ import (
"github.com/pivotal-cf/brokerapi/v11/handlers"
"github.com/pivotal-cf/brokerapi/v11/handlers/fakes"
"github.com/pivotal-cf/brokerapi/v11/middlewares"
"github.com/pkg/errors"
)

var _ = Describe("LastBindingOperation", func() {
Expand Down

0 comments on commit 654f8c1

Please sign in to comment.