cleanup: replace grpc.WithInsecure with insecure.NewCredentials (#5177)

This commit is contained in:
赵延
2022-02-10 03:17:46 +08:00
committed by GitHub
parent 91967153f5
commit c44f627fd1
48 changed files with 112 additions and 70 deletions

View File

@ -30,6 +30,7 @@ import (
"github.com/golang/protobuf/proto"
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/internal/grpctest"
rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
pb "google.golang.org/grpc/reflection/grpc_testing"
@ -205,7 +206,7 @@ func (x) TestReflectionEnd2end(t *testing.T) {
go s.Serve(lis)
// Create client.
conn, err := grpc.Dial(lis.Addr().String(), grpc.WithInsecure())
conn, err := grpc.Dial(lis.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatalf("cannot connect to server: %v", err)
}