Skip to content

Instantly share code, notes, and snippets.



Last active Dec 30, 2019
What would you like to do?
Go Google protoc insecure GrpcServicesClient TodoWorld Example
package main
import (
context "context"
pb "TodoWorld/services"
func main() {
conn, err := grpc.Dial("", grpc.WithInsecure())
if err != nil {
log.Fatalf("fail to dial: %v", err)
defer conn.Close()
client := pb.NewGrpcServicesClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
response, err := client.GetHello(ctx, &pb.Hello{Name: "gRPC Go"})
if err != nil {
log.Fatalf("GetHello: %v", err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment