mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 12:10:00 +00:00
[Go] Working on a go example plus fixing go grpc code (#6448)
Implemented server.go and half implemented client.go Finishes implementation for greeter go example Update grpc code for monster.fbs Adds a couple of cpp methods Adhere to gofmt standards Adds a readme for issues with grpc
This commit is contained in:
@@ -2,12 +2,14 @@ package testing
|
||||
|
||||
import (
|
||||
"../../tests/MyGame/Example"
|
||||
flatbuffers "github.com/google/flatbuffers/go"
|
||||
|
||||
"context"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/encoding"
|
||||
)
|
||||
|
||||
type server struct{}
|
||||
@@ -75,7 +77,7 @@ func TestGRPC(t *testing.T) {
|
||||
t.Fatalf("Failed to listen: %v", err)
|
||||
}
|
||||
ser := grpc.NewServer()
|
||||
encoding.RegisterCodec(flatbuffers.FlatbuffersCodec{})
|
||||
encoding.RegisterCodec(flatbuffers.FlatbuffersCodec{})
|
||||
Example.RegisterMonsterStorageServer(ser, &server{})
|
||||
go func() {
|
||||
if err := ser.Serve(lis); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user