mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Fix JSON unmarshaling
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user