From add9c0b9f2f28679a94da4c643f74282b932ca23 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 28 Apr 2016 14:38:30 -0700 Subject: [PATCH] Change NewClientConn so that all options need to be specified by caller --- benchmark/benchmark.go | 3 --- benchmark/benchmark_test.go | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go index 5a9c733d..5bb87ea0 100644 --- a/benchmark/benchmark.go +++ b/benchmark/benchmark.go @@ -192,9 +192,6 @@ func DoGenericStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallCli // NewClientConn creates a gRPC client connection to addr. func NewClientConn(addr string, opts ...grpc.DialOption) *grpc.ClientConn { - if len(opts) <= 0 { - opts = append(opts, grpc.WithInsecure()) - } conn, err := grpc.Dial(addr, opts...) if err != nil { grpclog.Fatalf("NewClientConn(%q) failed to create a ClientConn %v", addr, err) diff --git a/benchmark/benchmark_test.go b/benchmark/benchmark_test.go index 65e97ad7..ccf0f457 100644 --- a/benchmark/benchmark_test.go +++ b/benchmark/benchmark_test.go @@ -18,7 +18,7 @@ func runUnary(b *testing.B, maxConcurrentCalls int) { b.StopTimer() target, stopper := StartServer("localhost:0") defer stopper() - conn := NewClientConn(target) + conn := NewClientConn(target, grpc.WithInsecure()) tc := testpb.NewBenchmarkServiceClient(conn) // Warm up connection. @@ -61,7 +61,7 @@ func runStream(b *testing.B, maxConcurrentCalls int) { b.StopTimer() target, stopper := StartServer("localhost:0") defer stopper() - conn := NewClientConn(target) + conn := NewClientConn(target, grpc.WithInsecure()) tc := testpb.NewBenchmarkServiceClient(conn) // Warm up connection.