rename ambiguous variable
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Adrien Marquès 2020-03-09 19:12:26 +01:00
parent 43c758b615
commit acdba4121b
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 2 additions and 3 deletions

View File

@ -74,14 +74,13 @@ func (res *Response) MarshalJSON() ([]byte, error) {
// ServeHTTP implements http.Handler and writes the API response.
func (res *Response) ServeHTTP(w http.ResponseWriter, r *http.Request) error {
w.Header().Set("Content-Type", "application/json;charset=UTF-8")
w.WriteHeader(res.Status)
fmt, err := json.Marshal(res)
encoded, err := json.Marshal(res)
if err != nil {
return err
}
w.Write(fmt)
w.Write(encoded)
return nil
}