Skip to content

Commit

Permalink
Replace depr DialContext with NewClient
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Apr 14, 2024
1 parent e817c56 commit 22e3d0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 22e3d0b

Please sign in to comment.