mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
Fixes printf printing
This commit is contained in:
@@ -246,7 +246,7 @@ func (b *Bitfinex) WebsocketClient() {
|
||||
chanInfo, ok := b.WebsocketSubdChannels[chanID]
|
||||
|
||||
if !ok {
|
||||
log.Println("Unable to locate chanID: %d", chanID)
|
||||
log.Printf("Unable to locate chanID: %d\n", chanID)
|
||||
} else {
|
||||
if len(chanData) == 2 {
|
||||
if reflect.TypeOf(chanData[1]).String() == "string" {
|
||||
|
||||
@@ -39,12 +39,12 @@ func (b *Bitstamp) PusherClient() {
|
||||
|
||||
dataChannelTrade, err := pusherClient.Bind("data")
|
||||
if err != nil {
|
||||
log.Printf("%s Websocket Bind error: ", b.GetName(), err)
|
||||
log.Printf("%s Websocket Bind error: %s\n", b.GetName(), err)
|
||||
continue
|
||||
}
|
||||
tradeChannelTrade, err := pusherClient.Bind("trade")
|
||||
if err != nil {
|
||||
log.Printf("%s Websocket Bind error: ", b.GetName(), err)
|
||||
log.Printf("%s Websocket Bind error: %s\n", b.GetName(), err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -141,9 +141,9 @@ func (b *BTCC) WebsocketClient() {
|
||||
for b.Enabled && b.Websocket {
|
||||
err := socketio.ConnectToSocket(BTCC_SOCKETIO_ADDRESS, BTCCSocket)
|
||||
if err != nil {
|
||||
log.Printf("%s Unable to connect to Websocket. Err: %s\n", err)
|
||||
log.Printf("%s Unable to connect to Websocket. Err: %s\n", b.GetName(), err)
|
||||
continue
|
||||
}
|
||||
log.Printf("%s Disconnected from Websocket.")
|
||||
log.Printf("%s Disconnected from Websocket.\n", b.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ func TestStringContains(t *testing.T) {
|
||||
expectedOutput := true
|
||||
actualResult := StringContains(originalInput, originalInputSubstring)
|
||||
if actualResult != expectedOutput {
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%s'. Actual '%s'", expectedOutput, actualResult))
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%t'. Actual '%t'", expectedOutput, actualResult))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,14 +213,14 @@ func TestExtractHost(t *testing.T) {
|
||||
expectedOutput := "localhost"
|
||||
actualResult := ExtractHost(address)
|
||||
if expectedOutput != actualResult {
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%f'. Actual '%f'.", expectedOutput, actualResult))
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%s'. Actual '%s'.", expectedOutput, actualResult))
|
||||
}
|
||||
|
||||
address = "192.168.1.100:1337"
|
||||
expectedOutput = "192.168.1.100"
|
||||
actualResult = ExtractHost(address)
|
||||
if expectedOutput != actualResult {
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%f'. Actual '%f'.", expectedOutput, actualResult))
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%s'. Actual '%s'.", expectedOutput, actualResult))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,6 +230,6 @@ func TestExtractPort(t *testing.T) {
|
||||
expectedOutput := 1337
|
||||
actualResult := ExtractPort(address)
|
||||
if expectedOutput != actualResult {
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%f'. Actual '%f'.", expectedOutput, actualResult))
|
||||
t.Error(fmt.Sprintf("Test failed. Expected '%d'. Actual '%d'.", expectedOutput, actualResult))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,9 +211,9 @@ func (h *HUOBI) WebsocketClient() {
|
||||
for h.Enabled && h.Websocket {
|
||||
err := socketio.ConnectToSocket(HUOBI_SOCKETIO_ADDRESS, HuobiSocket)
|
||||
if err != nil {
|
||||
log.Printf("%s Unable to connect to Websocket. Err: %s\n", err)
|
||||
log.Printf("%s Unable to connect to Websocket. Err: %s\n", h.GetName(), err)
|
||||
continue
|
||||
}
|
||||
log.Printf("%s Disconnected from Websocket.")
|
||||
log.Printf("%s Disconnected from Websocket.\n", h.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ func (o *OKCoin) WebsocketClient() {
|
||||
if success != "true" && success != nil {
|
||||
errorCodeStr, ok := errorcode.(string)
|
||||
if !ok {
|
||||
log.Printf("%s Websocket: Unable to convert errorcode to string.\n", o.GetName)
|
||||
log.Printf("%s Websocket: Unable to convert errorcode to string.\n", o.GetName())
|
||||
log.Printf("%s Websocket: channel %s error code: %s.\n", o.GetName(), channelStr, errorcode)
|
||||
} else {
|
||||
log.Printf("%s Websocket: channel %s error: %s.\n", o.GetName(), channelStr, o.WebsocketErrors[errorCodeStr])
|
||||
|
||||
Reference in New Issue
Block a user