From 37da9ac040b3c4909fb91b1a4e73a9f28e714aa1 Mon Sep 17 00:00:00 2001 From: FZambia Date: Fri, 1 Nov 2024 08:48:41 +0200 Subject: [PATCH] rename field in ConnectCodeToHTTPStatusTransform --- internal/tools/code_translate.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/tools/code_translate.go b/internal/tools/code_translate.go index 138db4cd68..28b6f2e904 100644 --- a/internal/tools/code_translate.go +++ b/internal/tools/code_translate.go @@ -12,8 +12,8 @@ type ConnectCodeToHTTPStatus struct { } type ConnectCodeToHTTPStatusTransform struct { - Code uint32 `mapstructure:"code" json:"code"` - ToResponse TransformedConnectErrorHttpResponse `mapstructure:"to_response" json:"to_response"` + Code uint32 `mapstructure:"code" json:"code"` + To TransformedConnectErrorHttpResponse `mapstructure:"to" json:"to"` } type TransformedConnectErrorHttpResponse struct { @@ -41,10 +41,10 @@ func ConnectErrorToToHTTPResponse(err error, transforms []ConnectCodeToHTTPStatu if t.Code != code { continue } - if t.ToResponse.Body == "" { - t.ToResponse.Body = body + if t.To.Body == "" { + t.To.Body = body } - return t.ToResponse, true + return t.To, true } } return TransformedConnectErrorHttpResponse{