review feedback

This commit is contained in:
Paul Bellamy committed 2015-09-22 15:09:32 +01:00
1 parent 74c3b0d079
commit 3e4d8a3ffe
5 files changed
+29 -17

No files matched your search

-5
View File
@@ -50,10 +50,6 @@ func unmarshalRequestBody(r *http.Request, target interface{}) error {
}
r.Body = ioutil.NopCloser(bytes.NewReader(body))
if len(body) == 0 {
return nil
}
d := json.NewDecoder(bytes.NewReader(body))
d.UseNumber() // don't want large numbers in scientific format
return d.Decode(&target)
@@ -66,7 +62,6 @@ func marshalRequestBody(r *http.Request, body interface{}) error {
}
r.Body = ioutil.NopCloser(bytes.NewReader(newBody))
r.ContentLength = int64(len(newBody))
r.Header.Set("Content-Type", "application/json")
return nil
}