Skip to content

Commit

Permalink
Use default go errors package instead of github.com/pkg/errors (#608)
Browse files Browse the repository at this point in the history
* use go errors package instead of pkg/errors

* remove errors in makefile
  • Loading branch information
rifkyazizf committed Aug 3, 2023
1 parent ca6be73 commit 36583ea
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -107,7 +107,7 @@ lint: $(BUF) $(COPYRIGHT) fmt docs
lint_module: ## Runs various static analysis against our code.
lint_module: $(FAILLINT) $(GOLANGCI_LINT) $(MISSPELL)
@echo ">> verifying modules being imported"
@cd $(DIR) && $(FAILLINT) -paths "errors=github.com/pkg/errors,fmt.{Print,Printf,Println},github.com/golang/protobuf=google.golang.org/protobuf" ./...
@cd $(DIR) && $(FAILLINT) -paths "fmt.{Print,Printf,Println},github.com/golang/protobuf=google.golang.org/protobuf" ./...

@echo ">> examining all of the Go files"
@cd $(DIR) && go vet -stdmethods=false ./...
Expand Down
1 change: 0 additions & 1 deletion go.mod
Expand Up @@ -3,7 +3,6 @@ module github.com/grpc-ecosystem/go-grpc-middleware/v2
go 1.19

require (
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
golang.org/x/net v0.8.0
golang.org/x/oauth2 v0.4.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Expand Up @@ -10,8 +10,6 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
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
3 changes: 1 addition & 2 deletions interceptors/logging/interceptors_test.go
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors"
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -563,7 +562,7 @@ func (s *loggingPayloadSuite) TestPingStream_LogsAllRequestsAndResponses() {
if got >= 4*messagesExpected {
return nil
}
return errors.Errorf("not enough log lines, waiting; got: %v", got)
return fmt.Errorf("not enough log lines, waiting; got: %v", got)
}))
s.assertPayloadLogLinesForMessage(s.logger.o.Lines(), "PingStream", interceptors.BidiStream)
}
Expand Down
2 changes: 1 addition & 1 deletion interceptors/ratelimit/ratelimit_test.go
Expand Up @@ -5,9 +5,9 @@ package ratelimit

import (
"context"
"errors"
"testing"

"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion interceptors/selector/selector_test.go
Expand Up @@ -5,10 +5,10 @@ package selector

import (
"context"
"errors"
"testing"

"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
)
Expand Down
3 changes: 1 addition & 2 deletions testing/testpb/test.manual_validator.pb.go
Expand Up @@ -3,9 +3,8 @@
package testpb

import (
"errors"
"math"

"github.com/pkg/errors"
)

func (x *PingRequest) Validate(bool) error {
Expand Down

0 comments on commit 36583ea

Please sign in to comment.