mirror of
https://github.com/SourceFellows/gobuch.git
synced 2024-10-22 22:05:35 +00:00
23 lines
445 B
Go
23 lines
445 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
|
|
"golang.source-fellows.com/samples/grpc/hello"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
func main() {
|
|
con, _ := grpc.Dial(":8080", grpc.WithInsecure())
|
|
client := hello.NewHelloWorldServiceClient(con)
|
|
|
|
ctx := context.Background()
|
|
answer, err := client.SayHello(ctx, &emptypb.Empty{})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
log.Println(answer.GetMessageText())
|
|
}
|