From 6a7af458d76d49d2ae5ff99a7921a0061f6b59e6 Mon Sep 17 00:00:00 2001 From: Trock Date: Tue, 13 Sep 2022 18:01:28 +0800 Subject: [PATCH] fix: handler_test.go service name --- gengokit/handlers/handler_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gengokit/handlers/handler_test.go b/gengokit/handlers/handler_test.go index 5c178ab..d2d0df4 100644 --- a/gengokit/handlers/handler_test.go +++ b/gengokit/handlers/handler_test.go @@ -77,7 +77,7 @@ func TestServerMethsTempl(t *testing.T) { } genBytes, err := ioutil.ReadAll(gen) const expected = ` - func (s protoService) ProtoMethod(ctx context.Context, in *pb.RequestMessage) (*pb.ResponseMessage, error){ + func (s Service) ProtoMethod(ctx context.Context, in *pb.RequestMessage) (*pb.ResponseMessage, error){ var resp pb.ResponseMessage return &resp, nil } @@ -221,13 +221,13 @@ func TestIsValidFunc(t *testing.T) { func init() {}` const valid = `package p; - func (s protoService) ProtoMethod(context.Context, pb.RequestMessage) (pb.ResponseMessage, error) {}` + func (s Service) ProtoMethod(context.Context, pb.RequestMessage) (pb.ResponseMessage, error) {}` const invalidRecv = `package p; - func (s fooService) ProtoMethod(context.Context, pb.RequestMessage) (pb.ResponseMessage, error) {}` + func (s Service) ProtoMethod(context.Context, pb.RequestMessage) (pb.ResponseMessage, error) {}` const invalidFuncName = `package p; - func (generalService) FOOBAR(context.Context, pb.RequestMessage) (pb.ResponseMessage, error) {}` + func (Service) FOOBAR(context.Context, pb.RequestMessage) (pb.ResponseMessage, error) {}` svcName := strings.ToLower(sd.Service.Name) @@ -324,13 +324,13 @@ func TestPruneDecls(t *testing.T) { } // ProtoMethod implements Service. - func (s protoService) ProtoMethod(ctx context.Context, in *pb.RequestMessage) (*pb.ResponseMessage, error) { + func (s Service) ProtoMethod(ctx context.Context, in *pb.RequestMessage) (*pb.ResponseMessage, error) { var resp pb.ResponseMessage return &resp, nil } // FOOBAR implements Service. - func (s protoService) FOOBAR(ctx context.Context, in *pb.RequestMessage) (*pb.ResponseMessage, error) { + func (s Service) FOOBAR(ctx context.Context, in *pb.RequestMessage) (*pb.ResponseMessage, error) { var resp pb.ResponseMessage return &resp, nil }