mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-19 21:18:07 +02:00
fix: typo on emptypb.Empty (#2150)
Co-authored-by: Guoqiang Ding <guoqiang10@staff.sina.com.cn>
This commit is contained in:
parent
8c0a354797
commit
035c2f5387
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user