diff --git a/rest/httpx/responses.go b/rest/httpx/responses.go index 7d2ce1e5..c57f76df 100644 --- a/rest/httpx/responses.go +++ b/rest/httpx/responses.go @@ -12,7 +12,6 @@ func Error(w http.ResponseWriter, err error) { } func Ok(w http.ResponseWriter) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") w.WriteHeader(http.StatusOK) } diff --git a/tools/goctl/api/gogen/genhandlers.go b/tools/goctl/api/gogen/genhandlers.go index 894aeb3c..57ea4e41 100644 --- a/tools/goctl/api/gogen/genhandlers.go +++ b/tools/goctl/api/gogen/genhandlers.go @@ -71,7 +71,7 @@ func genHandler(dir string, group spec.Group, route spec.Route) error { if len(route.RequestType.Name) == 0 { req = "" } - var logicResponse = "" + var logicResponse string var writeResponse = "nil, nil" var respWriter = `httpx.WriteJson(w, http.StatusOK, resp)` if len(route.ResponseType.Name) > 0 { diff --git a/tools/goctl/api/gogen/genroutes.go b/tools/goctl/api/gogen/genroutes.go index 8897768d..75221edd 100644 --- a/tools/goctl/api/gogen/genroutes.go +++ b/tools/goctl/api/gogen/genroutes.go @@ -77,11 +77,11 @@ func genRoutes(dir string, api *spec.ApiSpec) error { },`, r.method, r.path, r.handler) } - jwt := "" + var jwt string if g.jwtEnabled { jwt = fmt.Sprintf(", ngin.WithJwt(serverCtx.Config.%s.AccessSecret)", g.authName) } - signature := "" + var signature string if g.signatureEnabled { signature = fmt.Sprintf(", ngin.WithSignature(serverCtx.Config.%s.Signature)", g.authName) }