mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 07:32:26 +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
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"../../tests/MyGame/Example"
|
|
||||||
flatbuffers "github.com/google/flatbuffers/go"
|
flatbuffers "github.com/google/flatbuffers/go"
|
||||||
|
"github.com/google/flatbuffers/tests/MyGame/Example"
|
||||||
|
|
||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
@@ -12,7 +12,9 @@ import (
|
|||||||
"google.golang.org/grpc/encoding"
|
"google.golang.org/grpc/encoding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type server struct{}
|
type server struct {
|
||||||
|
Example.UnimplementedMonsterStorageServer
|
||||||
|
}
|
||||||
|
|
||||||
// test used to send and receive in grpc methods
|
// test used to send and receive in grpc methods
|
||||||
var test = "Flatbuffers"
|
var test = "Flatbuffers"
|
||||||
@@ -65,8 +67,12 @@ func RetrieveClient(c Example.MonsterStorageClient, t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Retrieve client failed: %v", err)
|
t.Fatalf("Retrieve client failed: %v", err)
|
||||||
}
|
}
|
||||||
if string(out.Name()) != test {
|
monster, err := out.Recv()
|
||||||
t.Errorf("RetrieveClient failed: expected=%s, got=%s\n", test, out.Name())
|
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()
|
t.Fail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user