From fd819cb1660e1cf2b589dc772bd60614dac2ce06 Mon Sep 17 00:00:00 2001 From: Rahul Khairwar Date: Tue, 7 Dec 2021 12:16:51 +0800 Subject: [PATCH] - Review changes --- interceptors/auth/auth_test.go | 3 +-- interceptors/auth/metadata.go | 4 ++-- interceptors/auth/metadata_test.go | 4 ++-- interceptors/retry/retry.go | 4 ++-- metadata/metadata_test.go | 4 ++-- testing/testpb/test.pb.go | 16 +++++++++++----- testing/testpb/test_grpc.pb.go | 1 + 7 files changed, 21 insertions(+), 15 deletions(-) diff --git a/interceptors/auth/auth_test.go b/interceptors/auth/auth_test.go index 6512a255a..b2bb712ff 100644 --- a/interceptors/auth/auth_test.go +++ b/interceptors/auth/auth_test.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -22,6 +20,7 @@ import ( "google.golang.org/grpc/status" "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth" + "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" "github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb" ) diff --git a/interceptors/auth/metadata.go b/interceptors/auth/metadata.go index 0b9a77a20..0c8fb3771 100644 --- a/interceptors/auth/metadata.go +++ b/interceptors/auth/metadata.go @@ -7,10 +7,10 @@ import ( "context" "strings" - "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" ) var ( diff --git a/interceptors/auth/metadata_test.go b/interceptors/auth/metadata_test.go index 748a85308..f1e62c9ed 100644 --- a/interceptors/auth/metadata_test.go +++ b/interceptors/auth/metadata_test.go @@ -7,12 +7,12 @@ import ( "context" "testing" - "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" - "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" grpcMetadata "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + + "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" ) func TestAuthFromMD(t *testing.T) { diff --git a/interceptors/retry/retry.go b/interceptors/retry/retry.go index b040199d5..564c662cb 100644 --- a/interceptors/retry/retry.go +++ b/interceptors/retry/retry.go @@ -10,13 +10,13 @@ import ( "sync" "time" - "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" - "golang.org/x/net/trace" "google.golang.org/grpc" "google.golang.org/grpc/codes" grpcMetadata "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + + "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" ) const ( diff --git a/metadata/metadata_test.go b/metadata/metadata_test.go index 6ec7fd89e..223317d69 100644 --- a/metadata/metadata_test.go +++ b/metadata/metadata_test.go @@ -7,10 +7,10 @@ import ( "context" "testing" - "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" - "github.com/stretchr/testify/assert" grpcMetadata "google.golang.org/grpc/metadata" + + "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" ) var parentKey struct{} diff --git a/testing/testpb/test.pb.go b/testing/testpb/test.pb.go index 06d20e878..c944d73cb 100644 --- a/testing/testpb/test.pb.go +++ b/testing/testpb/test.pb.go @@ -1,16 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel +// protoc-gen-go v1.25.0 // protoc v3.13.0 // source: test.proto package testpb import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( @@ -20,6 +22,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type PingEmptyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -652,8 +658,8 @@ var file_test_proto_rawDesc = []byte{ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, - 0x01, 0x30, 0x01, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x3b, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x30, 0x01, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x3b, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/testing/testpb/test_grpc.pb.go b/testing/testpb/test_grpc.pb.go index e3b842d15..59f0d6dbd 100644 --- a/testing/testpb/test_grpc.pb.go +++ b/testing/testpb/test_grpc.pb.go @@ -4,6 +4,7 @@ package testpb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status"