Created
February 24, 2022 14:49
-
-
Save TonPC64/475a15213297037559c6724539ae60ea to your computer and use it in GitHub Desktop.
This file contains 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 callSayHello(ctx context.Context, c api.HelloServiceClient) { | |
md := metadata.Pairs( | |
"timestamp", time.Now().Format(time.StampNano), | |
) | |
ctx = metadata.NewOutgoingContext(ctx, md) | |
response, err := c.SayHello(ctx, &api.HelloRequest{Greeting: "World"}) | |
if err != nil { | |
log.Fatalf("Error when calling SayHello: %s", err) | |
} | |
log.Printf("Response from server: %s", response.Reply) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment