Created
June 25, 2020 21:49
-
-
Save RicardoLinck/84c9c0772f8891c6fadf267337071485 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sum(c calculatorpb.CalculatorServiceClient) { | |
req := &calculatorpb.SumRequest{ | |
NumA: 3, | |
NumB: 10, | |
} | |
ctx := metadata.AppendToOutgoingContext(context.Background(), "user", "test") | |
res, err := c.Sum(ctx, req) | |
if err != nil { | |
log.Fatalf("Error calling Sum RPC: %v", err) | |
} | |
log.Printf("Response: %d\n", res.Result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment