From f93c690ae7fa6a494e69a64d6a14f1a3b7450074 Mon Sep 17 00:00:00 2001 From: bilalcaliskan Date: Sat, 1 Jun 2024 16:02:48 +0300 Subject: [PATCH] fix: fix linter error (staticcheck) --- cmd/cli/add/add.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cli/add/add.go b/cmd/cli/add/add.go index 389549c..d91c34d 100644 --- a/cmd/cli/add/add.go +++ b/cmd/cli/add/add.go @@ -33,12 +33,12 @@ to quickly create a Cobra application.`, }, RunE: func(cmd *cobra.Command, args []string) error { // Set up a connection to the server. - conn, err := grpc.Dial("localhost:50051", grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials())) + cl, err := grpc.NewClient("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { log.Fatalf("did not connect: %v", err) } - defer conn.Close() - c := pb.NewRouteManagerClient(conn) + defer cl.Close() + c := pb.NewRouteManagerClient(cl) // Contact the server and print out its response. ctx, cancel := context.WithTimeout(context.Background(), time.Second)