mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 23:16:54 +00:00
Added structs for Ticker information for various exchanges.
This commit is contained in:
12
common.go
12
common.go
@@ -3,6 +3,8 @@ package main
|
||||
import (
|
||||
"net/http"
|
||||
"fmt"
|
||||
"strings"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"errors"
|
||||
)
|
||||
@@ -35,3 +37,13 @@ func SendHTTPRequest(url string, jsonDecode bool, result interface{}) (err error
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func JsonDecode(data string, result interface{}) (err error) {
|
||||
r := json.NewDecoder(strings.NewReader(data))
|
||||
err = r.Decode(result)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user