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)