mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
fixing string field contains invalid UTF-8 issue (#2164)
This commit is contained in:
@ -56,7 +56,7 @@ func (s *testServer) CallPcreInvalid(ctx context.Context, req *pb.Request, rsp *
|
||||
// TestHello implements helloworld.GreeterServer
|
||||
func (s *testServer) Call(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
|
||||
if req.Name == "Error" {
|
||||
return &errors.Error{Id: "1", Code: 99, Detail: "detail"}
|
||||
return &errors.Error{Id: "1", Code: 99, Detail: "detail\xc5"}
|
||||
}
|
||||
|
||||
rsp.Msg = "Hello " + req.Name
|
||||
@ -196,7 +196,7 @@ func TestGRPCServer(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatalf("invalid error received %#+v\n", st.Details()[0])
|
||||
}
|
||||
if verr.Code != 99 && verr.Id != "1" && verr.Detail != "detail" {
|
||||
if verr.Code != 99 || verr.Id != "1" || verr.Detail != "detail" {
|
||||
t.Fatalf("invalid error received %#+v\n", verr)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user