diff --git a/gen/_template/response_encode.tmpl b/gen/_template/response_encode.tmpl index 7fa192bb2..1deab59c5 100644 --- a/gen/_template/response_encode.tmpl +++ b/gen/_template/response_encode.tmpl @@ -9,7 +9,7 @@ {{- if $.Error }} {{- $otel := $.OpenTelemetryEnabled }} -func encodeErrorResponse(response {{ $.ErrorGoType }}, w http.ResponseWriter, span trace.Span) error { +func encodeErrorResponse(response {{ $.ErrorGoType }}, w http.ResponseWriter, {{ if $otel }}span trace.Span{{ end }}) error { {{- $infos := $.Error.ResponseInfo $otel }} {{- if eq (len $infos) 1 }} {{- range $info := $infos }}