From 36515821099d6472944e9847d07e3e8e47e42904 Mon Sep 17 00:00:00 2001 From: wmarinic <32562680+wmarinic@users.noreply.github.com> Date: Tue, 26 Jul 2022 05:49:58 +1000 Subject: [PATCH] fixed gorilla required header error shadowing (#689) --- pkg/codegen/templates/gorilla/gorilla-middleware.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl b/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl index 34b866a14..d660a0b69 100644 --- a/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl +++ b/pkg/codegen/templates/gorilla/gorilla-middleware.tmpl @@ -117,7 +117,7 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(w http.ResponseWriter, r *http.Requ params.{{.GoName}} = {{if not .Required}}&{{end}}{{.GoName}} } {{if .Required}}else { - err := fmt.Errorf("Header parameter {{.ParamName}} is required, but not found") + err = fmt.Errorf("Header parameter {{.ParamName}} is required, but not found") siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "{{.ParamName}}", Err: err}) return }{{end}}