Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func main() {
- // Set up a connection to the server.
- conn, err := grpc.Dial(address, grpc.WithInsecure())
- if err != nil {
- log.Fatalf("did not connect: %v", err)
- }
- defer conn.Close()
- c := pb.NewGreeterClient(conn)
- // Contact the server and print out its response.
- name := defaultName
- if len(os.Args) > 1 {
- name = os.Args[1]
- }
- log.Println("call SayHello")
- ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
- ....
- }
Add Comment
Please, Sign In to add comment