Update json.go

This commit is contained in:
田欧 2019-03-05 19:42:00 +08:00 committed by GitHub
parent 5e36505f59
commit cdc85887c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,10 +65,6 @@ func WriteJSON(w http.ResponseWriter, obj interface{}) error {
writeContentType(w, jsonContentType)
encoder := json.NewEncoder(w)
err := encoder.Encode(&obj)
if err != nil {
return err
}
_, err = w.Write(jsonBytes)
return err
}