瀏覽代碼

remote handler blank line when .HasRequest is false (#986)

Vee Zhang 3 年之前
父節點
當前提交
c26c187e11
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      tools/goctl/api/gogen/genhandlers.go

+ 2 - 2
tools/goctl/api/gogen/genhandlers.go

@@ -28,9 +28,9 @@ func {{.HandlerName}}(ctx *svc.ServiceContext) http.HandlerFunc {
 		if err := httpx.Parse(r, &req); err != nil {
 			httpx.Error(w, err)
 			return
-		}{{end}}
+		}
 
-		l := logic.New{{.LogicType}}(r.Context(), ctx)
+		{{end}}l := logic.New{{.LogicType}}(r.Context(), ctx)
 		{{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}req{{end}})
 		if err != nil {
 			httpx.Error(w, err)