Skip to content

Instantly share code, notes, and snippets.

@nleiva
Created July 9, 2019 00:14
Show Gist options
  • Save nleiva/b695e4f8c530efb0f5ca327fa6a5decf to your computer and use it in GitHub Desktop.
Save nleiva/b695e4f8c530efb0f5ca327fa6a5decf to your computer and use it in GitHub Desktop.
// Client
conn, err := grpc.Dial(address, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
}
defer conn.Close()
// Server
s := grpc.NewServer()
// ... register gRPC services ...
if err = s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment