diff --git a/.appveyor.yml b/.appveyor.yml index 70fdfe27e3a..4ff0831851d 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 ccb81b9d68b..a0835d4f1e4 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 01801fe0788..4d7624b1f33 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 73a0507a4fd..b7c7a0f7f05 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 338300cebd3..1b7031e379a 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 df3984c63ac..78ef4347ce1 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 e1c5a02f36b..79b9eca2cc8 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 865243d90e8..73b0e534c39 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