Guest User

Untitled

a guest
Aug 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. func main() {
  2. // Set up a connection to the server.
  3. conn, err := grpc.Dial(address, grpc.WithInsecure())
  4. if err != nil {
  5. log.Fatalf("did not connect: %v", err)
  6. }
  7. defer conn.Close()
  8. c := pb.NewGreeterClient(conn)
  9.  
  10. // Contact the server and print out its response.
  11. name := defaultName
  12. if len(os.Args) > 1 {
  13. name = os.Args[1]
  14. }
  15. log.Println("call SayHello")
  16. ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
  17. ....
  18. }
Add Comment
Please, Sign In to add comment