diff options
author | mustiikhalil <mustii@mmk.one> | 2021-05-20 21:32:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-20 11:32:56 -0700 |
commit | 8937dcfd78531ab0e0691e7c1d4fc0377f3bd14f (patch) | |
tree | f4ec6e0c0de565e246168b90a6fb8b829726f064 /grpc | |
parent | 512d5a68970d4188b6219593eda4dc38f79823c9 (diff) | |
download | flatbuffers-8937dcfd78531ab0e0691e7c1d4fc0377f3bd14f.tar.gz flatbuffers-8937dcfd78531ab0e0691e7c1d4fc0377f3bd14f.tar.bz2 flatbuffers-8937dcfd78531ab0e0691e7c1d4fc0377f3bd14f.zip |
Updates go lang support to allow other languages to communicate with it (#6653)
Diffstat (limited to 'grpc')
-rw-r--r-- | grpc/examples/go/greeter/server/go.mod | 2 | ||||
-rw-r--r-- | grpc/examples/go/greeter/server/main.go | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/grpc/examples/go/greeter/server/go.mod b/grpc/examples/go/greeter/server/go.mod index 2572feee..a5bbd9b2 100644 --- a/grpc/examples/go/greeter/server/go.mod +++ b/grpc/examples/go/greeter/server/go.mod @@ -7,5 +7,5 @@ replace github.com/google/flatbuffers/grpc/examples/go/greeter/models v0.0.0 => require ( github.com/google/flatbuffers v1.12.0 github.com/google/flatbuffers/grpc/examples/go/greeter/models v0.0.0 - google.golang.org/grpc v1.35.0 + google.golang.org/grpc v1.39.0-dev ) diff --git a/grpc/examples/go/greeter/server/main.go b/grpc/examples/go/greeter/server/main.go index 61914208..a5bb3a44 100644 --- a/grpc/examples/go/greeter/server/main.go +++ b/grpc/examples/go/greeter/server/main.go @@ -9,7 +9,6 @@ import ( flatbuffers "github.com/google/flatbuffers/go" models "github.com/google/flatbuffers/grpc/examples/go/greeter/models" "google.golang.org/grpc" - "google.golang.org/grpc/encoding" ) var ( @@ -68,8 +67,8 @@ func main() { if err != nil { log.Fatalf("failed to listen: %v", err) } - grpcServer := grpc.NewServer() - encoding.RegisterCodec(flatbuffers.FlatbuffersCodec{}) + codec := &flatbuffers.FlatbuffersCodec{} + grpcServer := grpc.NewServer(grpc.ForceServerCodec(codec)) models.RegisterGreeterServer(grpcServer, newServer()) if err := grpcServer.Serve(lis); err != nil { fmt.Print(err) |