mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 23:16:51 +00:00
Split up common.go, file path fixes and much more
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/common"
|
||||
)
|
||||
@@ -35,7 +36,7 @@ func StructValsToURLVals(v interface{}) (url.Values, error) {
|
||||
if structType.Field(i).Tag != "" {
|
||||
jsonTag := structType.Field(i).Tag.Get("json")
|
||||
if jsonTag != "" {
|
||||
split := common.SplitStrings(jsonTag, ",")
|
||||
split := strings.Split(jsonTag, ",")
|
||||
outgoingTag = split[0]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
@@ -152,12 +153,12 @@ func (b *Bitmex) wsHandleIncomingData() {
|
||||
}
|
||||
|
||||
message := string(resp.Raw)
|
||||
if common.StringContains(message, "pong") {
|
||||
if strings.Contains(message, "pong") {
|
||||
pongChan <- 1
|
||||
continue
|
||||
}
|
||||
|
||||
if common.StringContains(message, "ping") {
|
||||
if strings.Contains(message, "ping") {
|
||||
err = b.wsSend("pong")
|
||||
if err != nil {
|
||||
b.Websocket.DataHandler <- err
|
||||
|
||||
Reference in New Issue
Block a user