From 035c2f5387191c935003ee9fc123d8d0444705c5 Mon Sep 17 00:00:00 2001 From: Guoqiang Ding Date: Mon, 4 Jul 2022 20:57:57 +0800 Subject: [PATCH] fix: typo on emptypb.Empty (#2150) Co-authored-by: Guoqiang Ding --- cmd/kratos/internal/proto/server/template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kratos/internal/proto/server/template.go b/cmd/kratos/internal/proto/server/template.go index 1d60ebbad..732947ae8 100644 --- a/cmd/kratos/internal/proto/server/template.go +++ b/cmd/kratos/internal/proto/server/template.go @@ -5,6 +5,7 @@ import ( "html/template" ) +//nolint:lll var serviceTemplate = ` {{- /* delete empty line */ -}} package service @@ -34,8 +35,7 @@ func New{{ .Service }}Service() *{{ .Service }}Service { {{- $s1 := "google.protobuf.Empty" }} {{ range .Methods }} {{- if eq .Type 1 }} -func (s *{{ .Service }}Service) {{ .Name }}(ctx context.Context, req {{ if eq .Request $s1 }}*emptypb.Empty -{{ else }}*pb.{{ .Request }}{{ end }}) ({{ if eq .Reply $s1 }}*emptypb.Empty{{ else }}*pb.{{ .Reply }}{{ end }}, error) { +func (s *{{ .Service }}Service) {{ .Name }}(ctx context.Context, req {{ if eq .Request $s1 }}*emptypb.Empty{{ else }}*pb.{{ .Request }}{{ end }}) ({{ if eq .Reply $s1 }}*emptypb.Empty{{ else }}*pb.{{ .Reply }}{{ end }}, error) { return {{ if eq .Reply $s1 }}&emptypb.Empty{}{{ else }}&pb.{{ .Reply }}{}{{ end }}, nil }