Skip to content

Commit

Permalink
rename field in ConnectCodeToHTTPStatusTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Nov 1, 2024
1 parent 76f1b46 commit 37da9ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/tools/code_translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 37da9ac

Please sign in to comment.