[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:
mustiikhalil
2021-02-19 12:47:59 +03:00
committed by GitHub
parent ae603b9770
commit 0c7ae58164
19 changed files with 840 additions and 205 deletions

View File

@@ -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 {