Merge pull request #26 from crackcomm/patch-1

Fix JSON unmarshaling
This commit is contained in:
thrasher
2017-03-31 12:33:04 +11:00
committed by GitHub

View File

@@ -264,23 +264,11 @@ func SendHTTPGetRequest(url string, jsonDecode bool, result interface{}) (err er
}
func JSONEncode(v interface{}) ([]byte, error) {
json, err := json.Marshal(&v)
if err != nil {
return nil, err
}
return json, nil
return json.Marshal(v)
}
func JSONDecode(data []byte, to interface{}) error {
err := json.Unmarshal(data, &to)
if err != nil {
return err
}
return nil
return json.Unmarshal(data, to)
}
func EncodeURLValues(url string, values url.Values) string {