Skip to content

Commit

Permalink
handling check in switch case itself
Browse files Browse the repository at this point in the history
  • Loading branch information
coolwednesday committed Dec 20, 2024
1 parent fb2cfa5 commit 371cf94
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/gofr/http/responder.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ func (r Responder) Respond(data interface{}, err error) {
case resTypes.Raw:
resp = v.Data
case resTypes.Response:
res := data.(resTypes.Response)

resp = response{Data: res.Data, Metadata: res.Metadata, Error: errorObj}
resp = response{Data: v.Data, Metadata: v.Metadata, Error: errorObj}
case resTypes.File:
r.w.Header().Set("Content-Type", v.ContentType)
r.w.WriteHeader(statusCode)
Expand Down

0 comments on commit 371cf94

Please sign in to comment.