mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
fix go_test implement error (#7012)
* fix(grpc): fix go_test implement error * fix(grpc): fix go_test implement error
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"../../tests/MyGame/Example"
|
||||
flatbuffers "github.com/google/flatbuffers/go"
|
||||
"github.com/google/flatbuffers/tests/MyGame/Example"
|
||||
|
||||
"context"
|
||||
"net"
|
||||
@@ -12,7 +12,9 @@ import (
|
||||
"google.golang.org/grpc/encoding"
|
||||
)
|
||||
|
||||
type server struct{}
|
||||
type server struct {
|
||||
Example.UnimplementedMonsterStorageServer
|
||||
}
|
||||
|
||||
// test used to send and receive in grpc methods
|
||||
var test = "Flatbuffers"
|
||||
@@ -65,8 +67,12 @@ func RetrieveClient(c Example.MonsterStorageClient, t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Retrieve client failed: %v", err)
|
||||
}
|
||||
if string(out.Name()) != test {
|
||||
t.Errorf("RetrieveClient failed: expected=%s, got=%s\n", test, out.Name())
|
||||
monster, err := out.Recv()
|
||||
if err != nil {
|
||||
t.Fatalf("Recv failed: %v", err)
|
||||
}
|
||||
if string(monster.Name()) != test {
|
||||
t.Errorf("RetrieveClient failed: expected=%s, got=%s\n", test, monster.Name())
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user