From 2b576abd1c3bfca2f962de0e024524f72d3652c0 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Thu, 2 May 2024 16:32:16 -0500 Subject: [PATCH] docs(testing): switch deprecated WithInsecure to WithTransportCredentials (#10091) The public [GRPC docs](https://pkg.go.dev/google.golang.org/grpc#WithInsecure) mention the following with regards to `grpc.WithInsecure`: > Deprecated: use WithTransportCredentials and insecure.NewCredentials() instead. Will be supported throughout 1.x. This change updates the example to use `WithTransportCredentials()` along with `insecure.NewCredentials()` instead of the deprecated option. --- testing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing.md b/testing.md index ea5bdca4a8cf..78bb35b3b6ed 100644 --- a/testing.md +++ b/testing.md @@ -99,6 +99,7 @@ import ( "google.golang.org/api/option" translatepb "google.golang.org/genproto/googleapis/cloud/translate/v3" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) func TestTranslateTextWithConcreteClient(t *testing.T) { @@ -123,7 +124,7 @@ func TestTranslateTextWithConcreteClient(t *testing.T) { client, err := translate.NewTranslationClient(ctx, option.WithEndpoint(fakeServerAddr), option.WithoutAuthentication(), - option.WithGRPCDialOption(grpc.WithInsecure()), + option.WithGRPCDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())), ) if err != nil { t.Fatal(err)