From e8bc3b5e76f5824eb40834f89e806959e3c47486 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Mon, 27 May 2019 14:10:54 +1000 Subject: [PATCH] Bump golangci-lint version to 1.16.0 (#311) --- .appveyor.yml | 2 +- .golangci.yml | 2 +- Makefile | 2 +- config/config_test.go | 2 +- exchanges/btcmarkets/btcmarkets_wrapper.go | 5 +++-- exchanges/btse/btse_websocket.go | 4 ---- exchanges/huobi/huobi_wrapper.go | 2 +- exchanges/localbitcoins/localbitcoins_wrapper.go | 5 ++--- 8 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 70fdfe27..4ff08318 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,7 +28,7 @@ before_test: test_script: # test back-end - - go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.15.0 + - go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0 - '%GOPATH%\bin\golangci-lint.exe run --verbose' - go test -race ./... diff --git a/.golangci.yml b/.golangci.yml index ccb81b9d..a0835d4f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -78,4 +78,4 @@ issues: - gosec service: - golangci-lint-version: 1.15.x \ No newline at end of file + golangci-lint-version: 1.16.x \ No newline at end of file diff --git a/Makefile b/Makefile index 01801fe0..4d7624b1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ LDFLAGS = -ldflags "-w -s" GCTPKG = github.com/thrasher-/gocryptotrader -LINTPKG = github.com/golangci/golangci-lint/cmd/golangci-lint@v1.15.0 +LINTPKG = github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0 LINTBIN = $(GOPATH)/bin/golangci-lint GCTLISTENPORT=9050 GCTPROFILERLISTENPORT=8085 diff --git a/config/config_test.go b/config/config_test.go index 73a0507a..b7c7a0f7 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -848,7 +848,7 @@ func TestReadConfig(t *testing.T) { err = readConfig.ReadConfig("bla") if err == nil { - t.Error("Test failed. TestReadConfig " + err.Error()) + t.Error("Test failed. TestReadConfig error cannot be nil") } err = readConfig.ReadConfig("") diff --git a/exchanges/btcmarkets/btcmarkets_wrapper.go b/exchanges/btcmarkets/btcmarkets_wrapper.go index 338300ce..1b7031e3 100644 --- a/exchanges/btcmarkets/btcmarkets_wrapper.go +++ b/exchanges/btcmarkets/btcmarkets_wrapper.go @@ -232,6 +232,7 @@ func (b *BTCMarkets) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.Ca orderIDInt, err := strconv.ParseInt(openOrders[i].ID, 10, 64) if err != nil { cancelAllOrdersResponse.OrderStatus[openOrders[i].ID] = err.Error() + continue } orderList = append(orderList, orderIDInt) } @@ -243,8 +244,8 @@ func (b *BTCMarkets) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.Ca } for i := range orders { - if err != nil { - cancelAllOrdersResponse.OrderStatus[strconv.FormatInt(orders[i].ID, 10)] = err.Error() + if !orders[i].Success { + cancelAllOrdersResponse.OrderStatus[strconv.FormatInt(orders[i].ID, 10)] = orders[i].ErrorMessage } } } diff --git a/exchanges/btse/btse_websocket.go b/exchanges/btse/btse_websocket.go index df3984c6..78ef4347 100644 --- a/exchanges/btse/btse_websocket.go +++ b/exchanges/btse/btse_websocket.go @@ -47,10 +47,6 @@ func (b *BTSE) WsConnect() error { b.Name, err) } - if err != nil { - return err - } - go b.WsHandleData() b.GenerateDefaultSubscriptions() diff --git a/exchanges/huobi/huobi_wrapper.go b/exchanges/huobi/huobi_wrapper.go index e1c5a02f..79b9eca2 100644 --- a/exchanges/huobi/huobi_wrapper.go +++ b/exchanges/huobi/huobi_wrapper.go @@ -47,7 +47,7 @@ func (h *HUOBI) Run() { if common.StringDataContains(h.BaseCurrencies.Strings(), "CNY") { cfg := config.GetConfig() exchCfg, errCNY := cfg.GetExchangeConfig(h.Name) - if err != nil { + if errCNY != nil { log.Errorf("%s failed to get exchange config. %s\n", h.Name, errCNY) return } diff --git a/exchanges/localbitcoins/localbitcoins_wrapper.go b/exchanges/localbitcoins/localbitcoins_wrapper.go index 865243d9..73b0e534 100644 --- a/exchanges/localbitcoins/localbitcoins_wrapper.go +++ b/exchanges/localbitcoins/localbitcoins_wrapper.go @@ -192,9 +192,8 @@ func (l *LocalBitcoins) SubmitOrder(p currency.Pair, side exchange.OrderSide, _ if err != nil { return submitOrderResponse, err } - if err == nil { - submitOrderResponse.IsOrderPlaced = true - } + + submitOrderResponse.IsOrderPlaced = true // Now to figure out what ad we just submitted // The only details we have are the params above