From 22e3d0b3d8f43f4a9f0308b8ff2f76ef0a1cc783 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Sun, 14 Apr 2024 08:51:19 -0700 Subject: [PATCH] Replace depr DialContext with NewClient --- example/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example/main.go b/example/main.go index d658832..75cc42a 100644 --- a/example/main.go +++ b/example/main.go @@ -33,6 +33,7 @@ import ( semconv "go.opentelemetry.io/otel/semconv/v1.12.0" "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) const ( @@ -98,7 +99,10 @@ func main() { ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) defer stop() - conn, err := grpc.DialContext(ctx, *targetPtr, grpc.WithBlock(), grpc.WithInsecure()) + conn, err := grpc.NewClient( + *targetPtr, + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) if err != nil { log.Fatal(err) }