diff --git a/.appveyor.yml b/.appveyor.yml index 11be377cfa5..3aef67cbab1 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.16.0 + - go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.18.0 - '%GOPATH%\bin\golangci-lint.exe run --verbose' - ps: >- if($env:APPVEYOR_SCHEDULED_BUILD -eq 'true') { diff --git a/.golangci.yml b/.golangci.yml index a0835d4f1e4..3fb7dc86210 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,10 +1,10 @@ run: - deadline: 30s + deadline: 1m0s issues-exit-code: 1 tests: true skip-dirs: - vendor - - web + - web/ - testdata linters: @@ -21,14 +21,13 @@ linters: - ineffassign # - deadcode - typecheck - - goimports - - govet # disabled by default linters +# - bodyclose - golint - stylecheck - gosec -# - interfacer +# - interfacer - unconvert # - dupl - goconst @@ -46,6 +45,7 @@ linters: - gocritic # - gochecknoinits # - gochecknoglobals +# - funlen linters-settings: govet: @@ -67,6 +67,7 @@ linters-settings: - wrapperFunc - importShadow - methodExprCall + - evalOrder issues: max-issues-per-linter: 0 diff --git a/.travis.yml b/.travis.yml index 7b00bb23e08..e04d4cf74b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ matrix: dist: xenial name: 'GoCryptoTrader [back-end] [linux]' go: - - 1.12.x + - 1.13.x env: - GO111MODULE=on install: true @@ -35,7 +35,7 @@ matrix: os: osx name: 'GoCryptoTrader [back-end] [darwin]' go: - - 1.12.x + - 1.13.x env: - GO111MODULE=on install: true diff --git a/Makefile b/Makefile index 2409ef92c50..df283681fde 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ LDFLAGS = -ldflags "-w -s" GCTPKG = github.com/thrasher-corp/gocryptotrader -LINTPKG = github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0 +LINTPKG = github.com/golangci/golangci-lint/cmd/golangci-lint@v1.18.0 LINTBIN = $(GOPATH)/bin/golangci-lint GCTLISTENPORT=9050 GCTPROFILERLISTENPORT=8085 diff --git a/config/config.go b/config/config.go index a3170688d6c..5082f2c925d 100644 --- a/config/config.go +++ b/config/config.go @@ -46,7 +46,7 @@ const ( // Constants here hold some messages const ( ErrExchangeNameEmpty = "exchange #%d name is empty" - ErrExchangeAvailablePairsEmpty = "exchange %s avaiable pairs is empty" + ErrExchangeAvailablePairsEmpty = "exchange %s available pairs is empty" ErrExchangeEnabledPairsEmpty = "exchange %s enabled pairs is empty" ErrExchangeBaseCurrenciesEmpty = "exchange %s base currencies is empty" ErrExchangeNotFound = "exchange %s not found" @@ -1190,33 +1190,36 @@ func (c *Config) DisableNTPCheck(input io.Reader) (string, error) { defer m.Unlock() reader := bufio.NewReader(input) - log.Warn("Your system time is out of sync this may cause issues with trading") + log.Warn("Your system time is out of sync, this may cause issues with trading") log.Warn("How would you like to show future notifications? (a)lert / (w)arn / (d)isable \n") - var answered = false - for ok := true; ok; ok = (!answered) { + var resp string + answered := false + for !answered { answer, err := reader.ReadString('\n') if err != nil { - return "", err + return resp, err } answer = strings.TrimRight(answer, "\r\n") switch answer { case "a": c.NTPClient.Level = 0 + resp = "Time sync has been set to alert" answered = true - return "Time sync has been set to alert", nil case "w": c.NTPClient.Level = 1 + resp = "Time sync has been set to warn only" answered = true - return "Time sync has been set to warn only", nil case "d": c.NTPClient.Level = -1 + resp = "Future notifications for out of time sync has been disabled" answered = true - return "Future notications for out time sync have been disabled", nil + default: + log.Warn("Invalid option selected, please try again (a)lert / (w)arn / (d)isable") } } - return "", errors.New("something went wrong NTPCheck should never make it this far") + return resp, nil } // CheckConnectionMonitorConfig checks and if zero value assigns default values diff --git a/config/config_test.go b/config/config_test.go index 48f6b9b1807..c5f59b18ec0 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1030,8 +1030,8 @@ func TestDisableNTPCheck(t *testing.T) { } disable, _ := c.DisableNTPCheck(strings.NewReader("d\n")) - if disable != "Future notications for out time sync have been disabled" { - t.Errorf("failed expected %v got %v", "Future notications for out time sync have been disabled", disable) + if disable != "Future notifications for out of time sync has been disabled" { + t.Errorf("failed expected %v got %v", "Future notifications for out of time sync has been disabled", disable) } _, err = c.DisableNTPCheck(strings.NewReader(" ")) diff --git a/currency/code.go b/currency/code.go index b3d065caca5..b5f9154bc64 100644 --- a/currency/code.go +++ b/currency/code.go @@ -546,7 +546,7 @@ var ( BAT = NewCode("BAT") ETP = NewCode("ETP") HOT = NewCode("HOT") - STRAT = NewCode("STRAT") + STRAT = NewCode("STRAT") // nolint: misspell GNT = NewCode("GNT") REP = NewCode("REP") SNT = NewCode("SNT") diff --git a/currency/code_test.go b/currency/code_test.go index 8b5e238b36e..b5d7c599757 100644 --- a/currency/code_test.go +++ b/currency/code_test.go @@ -8,31 +8,31 @@ import ( func TestRoleString(t *testing.T) { if Unset.String() != UnsetRollString { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", UnsetRollString, Unset) } if Fiat.String() != FiatCurrencyString { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", FiatCurrencyString, Fiat) } if Cryptocurrency.String() != CryptocurrencyString { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", CryptocurrencyString, Cryptocurrency) } if Token.String() != TokenString { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", TokenString, Token) } if Contract.String() != ContractString { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", ContractString, Contract) } @@ -40,7 +40,7 @@ func TestRoleString(t *testing.T) { var random Role = 1 << 7 if random.String() != "UNKNOWN" { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", "UNKNOWN", random) } @@ -54,7 +54,7 @@ func TestRoleMarshalJSON(t *testing.T) { expected := `"fiatCurrency"` if string(d) != expected { - t.Errorf("Test Failed - Role MarshalJSON() error expected %s but recieved %s", + t.Errorf("Test Failed - Role MarshalJSON() error expected %s but received %s", expected, string(d)) } @@ -100,37 +100,37 @@ func TestRoleUnmarshalJSON(t *testing.T) { } if incoming.RoleOne != Unset { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", Unset, incoming.RoleOne) } if incoming.RoleTwo != Cryptocurrency { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", Cryptocurrency, incoming.RoleTwo) } if incoming.RoleThree != Fiat { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", Fiat, incoming.RoleThree) } if incoming.RoleFour != Token { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", Token, incoming.RoleFour) } if incoming.RoleFive != Contract { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", Contract, incoming.RoleFive) } if incoming.RoleUnknown != Unset { - t.Errorf("Test Failed - Role String() error expected %s but recieved %s", + t.Errorf("Test Failed - Role String() error expected %s but received %s", incoming.RoleFive, incoming.RoleUnknown) } @@ -139,35 +139,35 @@ func TestRoleUnmarshalJSON(t *testing.T) { func TestBaseCode(t *testing.T) { var main BaseCodes if main.HasData() { - t.Errorf("Test Failed - BaseCode HasData() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode HasData() error expected false but received %v", main.HasData()) } catsCode := main.Register("CATS") if !main.HasData() { - t.Errorf("Test Failed - BaseCode HasData() error expected true but recieved %v", + t.Errorf("Test Failed - BaseCode HasData() error expected true but received %v", main.HasData()) } if !main.Register("CATS").Match(catsCode) { - t.Errorf("Test Failed - BaseCode Match() error expected true but recieved %v", + t.Errorf("Test Failed - BaseCode Match() error expected true but received %v", false) } if main.Register("DOGS").Match(catsCode) { - t.Errorf("Test Failed - BaseCode Match() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode Match() error expected false but received %v", true) } loadedCurrencies := main.GetCurrencies() if loadedCurrencies.Contains(main.Register("OWLS")) { - t.Errorf("Test Failed - BaseCode Contains() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode Contains() error expected false but received %v", true) } if !loadedCurrencies.Contains(catsCode) { - t.Errorf("Test Failed - BaseCode Contains() error expected true but recieved %v", + t.Errorf("Test Failed - BaseCode Contains() error expected true but received %v", false) } @@ -194,22 +194,22 @@ func TestBaseCode(t *testing.T) { contract := main.Register("XBTUSD") if contract.IsFiatCurrency() { - t.Errorf("Test Failed - BaseCode IsFiatCurrency() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode IsFiatCurrency() error expected false but received %v", true) } if contract.IsCryptocurrency() { - t.Errorf("Test Failed - BaseCode IsFiatCurrency() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode IsFiatCurrency() error expected false but received %v", true) } if contract.IsDefaultFiatCurrency() { - t.Errorf("Test Failed - BaseCode IsDefaultFiatCurrency() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode IsDefaultFiatCurrency() error expected false but received %v", true) } if contract.IsDefaultFiatCurrency() { - t.Errorf("Test Failed - BaseCode IsFiatCurrency() error expected false but recieved %v", + t.Errorf("Test Failed - BaseCode IsFiatCurrency() error expected false but received %v", true) } @@ -229,32 +229,32 @@ func TestBaseCode(t *testing.T) { } if len(full.Contracts) != 1 { - t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but recieved %v", + t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but received %v", len(full.Contracts)) } if len(full.Cryptocurrency) != 2 { - t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but recieved %v", + t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but received %v", len(full.Cryptocurrency)) } if len(full.FiatCurrency) != 1 { - t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but recieved %v", + t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but received %v", len(full.FiatCurrency)) } if len(full.Token) != 1 { - t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but recieved %v", + t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 1 but received %v", len(full.Token)) } if len(full.UnsetCurrency) != 3 { - t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 3 but recieved %v", + t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 3 but received %v", len(full.UnsetCurrency)) } if !full.LastMainUpdate.IsZero() { - t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 0 but recieved %s", + t.Errorf("Test Failed - BaseCode GetFullCurrencyData() error expected 0 but received %s", full.LastMainUpdate) } } @@ -263,7 +263,7 @@ func TestCodeString(t *testing.T) { expected := "TEST" cc := NewCode("TEST") if cc.String() != expected { - t.Errorf("Test Failed - Currency Code String() error expected %s but recieved %s", + t.Errorf("Test Failed - Currency Code String() error expected %s but received %s", expected, cc) } } @@ -272,7 +272,7 @@ func TestCodeLower(t *testing.T) { expected := "test" cc := NewCode("TEST") if cc.Lower().String() != expected { - t.Errorf("Test Failed - Currency Code Lower() error expected %s but recieved %s", + t.Errorf("Test Failed - Currency Code Lower() error expected %s but received %s", expected, cc.Lower()) } @@ -282,7 +282,7 @@ func TestCodeUpper(t *testing.T) { expected := "TEST" cc := NewCode("test") if cc.Upper().String() != expected { - t.Errorf("Test Failed - Currency Code Upper() error expected %s but recieved %s", + t.Errorf("Test Failed - Currency Code Upper() error expected %s but received %s", expected, cc.Upper()) } @@ -307,7 +307,7 @@ func TestCodeUnmarshalJSON(t *testing.T) { } if unmarshalHere.String() != expected { - t.Errorf("Test Failed - Currency Code Upper() error expected %s but recieved %s", + t.Errorf("Test Failed - Currency Code Upper() error expected %s but received %s", expected, unmarshalHere) } @@ -328,7 +328,7 @@ func TestCodeMarshalJSON(t *testing.T) { } if string(encoded) != expectedJSON { - t.Errorf("Test Failed - Currency Code Upper() error expected %s but recieved %s", + t.Errorf("Test Failed - Currency Code Upper() error expected %s but received %s", expectedJSON, string(encoded)) } @@ -346,7 +346,7 @@ func TestCodeMarshalJSON(t *testing.T) { newExpectedJSON := `{"sweetCodes":""}` if string(encoded) != newExpectedJSON { - t.Errorf("Test Failed - Currency Code Upper() error expected %s but recieved %s", + t.Errorf("Test Failed - Currency Code Upper() error expected %s but received %s", newExpectedJSON, string(encoded)) } } @@ -419,7 +419,7 @@ func TestItemString(t *testing.T) { } if newItem.String() != expected { - t.Errorf("Test Failed - Item String() error expected %s but recieved %s", + t.Errorf("Test Failed - Item String() error expected %s but received %s", expected, &newItem) } diff --git a/currency/coinmarketcap/coinmarketcap.go b/currency/coinmarketcap/coinmarketcap.go index f34f97b3b1f..a6bf2541cb9 100644 --- a/currency/coinmarketcap/coinmarketcap.go +++ b/currency/coinmarketcap/coinmarketcap.go @@ -154,28 +154,28 @@ func (c *Coinmarketcap) GetCryptocurrencyIDMap() ([]CryptoCurrencyMap, error) { // GetCryptocurrencyHistoricalListings returns a paginated list of all // cryptocurrencies with market data for a given historical time. func (c *Coinmarketcap) GetCryptocurrencyHistoricalListings() ([]CryptocurrencyHistoricalListings, error) { - return nil, errors.New("this endpoint is not yet available") + return nil, common.ErrNotYetImplemented // NOTE unreachable code but will be utilised at a later date // resp := struct { // Data []CryptocurrencyHistoricalListings `json:"data"` // Status Status `json:"status"` // }{} - // err := c.CheckAccountPlan(0) + // nolint: gocritic err := c.CheckAccountPlan(0) // if err != nil { // return resp.Data, err // } - // err = c.SendHTTPRequest(http.MethodGet, endpointCryptocurrencyHistoricalListings, nil, &resp) + // nolint: gocritic err = c.SendHTTPRequest(http.MethodGet, endpointCryptocurrencyHistoricalListings, nil, &resp) // if err != nil { // return resp.Data, err // } - //nolint:gocritic if resp.Status.ErrorCode != 0 { + // nolint: gocritic nolint:gocritic if resp.Status.ErrorCode != 0 { // return resp.Data, errors.New(resp.Status.ErrorMessage) // } - //nolint:gocritic return resp.Data, nil + // nolint: gocritic nolint:gocritic return resp.Data, nil } // GetCryptocurrencyLatestListing returns a paginated list of all diff --git a/currency/conversion_test.go b/currency/conversion_test.go index 2b5fb23d7ae..18db2b71592 100644 --- a/currency/conversion_test.go +++ b/currency/conversion_test.go @@ -110,7 +110,7 @@ func TestConversionsRatesSystem(t *testing.T) { var SuperDuperConversionSystem ConversionRates if SuperDuperConversionSystem.HasData() { - t.Fatalf("Test Failed - HasData() error expected false but recieved %v", + t.Fatalf("Test Failed - HasData() error expected false but received %v", SuperDuperConversionSystem.HasData()) } @@ -147,11 +147,11 @@ func TestConversionsRatesSystem(t *testing.T) { err = SuperDuperConversionSystem.Update(nil) if err == nil { - t.Fatal("Test Failed - Update() error cannnot be nil") + t.Fatal("Test Failed - Update() error cannot be nil") } if !SuperDuperConversionSystem.HasData() { - t.Fatalf("Test Failed - HasData() error expected true but recieved %v", + t.Fatalf("Test Failed - HasData() error expected true but received %v", SuperDuperConversionSystem.HasData()) } @@ -162,7 +162,7 @@ func TestConversionsRatesSystem(t *testing.T) { r := *p * 1000 expectedRate := 1396.9317581 if r != expectedRate { - t.Errorf("Test Failed - Convert() error expected %.13f but recieved %.13f", + t.Errorf("Test Failed - Convert() error expected %.13f but received %.13f", expectedRate, r) } @@ -170,7 +170,7 @@ func TestConversionsRatesSystem(t *testing.T) { inverseR := *pi * expectedRate expectedInverseRate := float64(1000) if inverseR != expectedInverseRate { - t.Errorf("Test Failed - Convert() error expected %.13f but recieved %.13f", + t.Errorf("Test Failed - Convert() error expected %.13f but received %.13f", expectedInverseRate, inverseR) } diff --git a/currency/currency_test.go b/currency/currency_test.go index 20008769010..f6e3dae7545 100644 --- a/currency/currency_test.go +++ b/currency/currency_test.go @@ -44,14 +44,14 @@ func TestUpdateBaseCurrency(t *testing.T) { } if GetBaseCurrency() != AUD { - t.Errorf("Test failed - GetBaseCurrency() expected %s but recieved %s", + t.Errorf("Test failed - GetBaseCurrency() expected %s but received %s", AUD, GetBaseCurrency()) } } func TestGetDefaultBaseCurrency(t *testing.T) { if GetDefaultBaseCurrency() != USD { - t.Errorf("Test failed - GetDefaultBaseCurrency() expected %s but recieved %s", + t.Errorf("Test failed - GetDefaultBaseCurrency() expected %s but received %s", USD, GetDefaultBaseCurrency()) } } @@ -59,7 +59,7 @@ func TestGetDefaultBaseCurrency(t *testing.T) { func TestGetDefaulCryptoCurrencies(t *testing.T) { expected := Currencies{BTC, LTC, ETH, DOGE, DASH, XRP, XMR} if !GetDefaultCryptocurrencies().Match(expected) { - t.Errorf("Test failed - GetDefaultCryptocurrencies() expected %s but recieved %s", + t.Errorf("Test failed - GetDefaultCryptocurrencies() expected %s but received %s", expected, GetDefaultCryptocurrencies()) } } @@ -67,7 +67,7 @@ func TestGetDefaulCryptoCurrencies(t *testing.T) { func TestGetDefaultFiatCurrencies(t *testing.T) { expected := Currencies{USD, AUD, EUR, CNY} if !GetDefaultFiatCurrencies().Match(expected) { - t.Errorf("Test failed - GetDefaultFiatCurrencies() expected %s but recieved %s", + t.Errorf("Test failed - GetDefaultFiatCurrencies() expected %s but received %s", expected, GetDefaultFiatCurrencies()) } } diff --git a/exchanges/bitflyer/bitflyer.go b/exchanges/bitflyer/bitflyer.go index 95bf0d94564..5348dd62791 100644 --- a/exchanges/bitflyer/bitflyer.go +++ b/exchanges/bitflyer/bitflyer.go @@ -397,7 +397,7 @@ func (b *Bitflyer) SendHTTPRequest(path string, result interface{}) error { // if you have access and update the authenticated requests // TODO: Fill out this function once API access is obtained func (b *Bitflyer) SendAuthHTTPRequest() { - // headers := make(map[string]string) + // nolint: gocritic headers := make(map[string]string) // headers["ACCESS-KEY"] = b.APIKey // headers["ACCESS-TIMESTAMP"] = strconv.FormatInt(time.Now().UnixNano(), 10) } diff --git a/exchanges/bitflyer/bitflyer_wrapper.go b/exchanges/bitflyer/bitflyer_wrapper.go index 6f1053c0768..16b89cdfd5c 100644 --- a/exchanges/bitflyer/bitflyer_wrapper.go +++ b/exchanges/bitflyer/bitflyer_wrapper.go @@ -1,7 +1,6 @@ package bitflyer import ( - "errors" "sync" "github.com/thrasher-corp/gocryptotrader/common" @@ -30,22 +29,25 @@ func (b *Bitflyer) Run() { log.Debugf("%s %d currencies enabled: %s.\n", b.GetName(), len(b.EnabledPairs), b.EnabledPairs) } - /* - marketInfo, err := b.GetMarkets() + /* nolint: gocritic + This has been disabled in master but enabled in engine due to multiple + asset support + + marketInfo, err := b.GetMarkets() + if err != nil { + log.Printf("%s Failed to get available symbols.\n", b.GetName()) + } else { + var exchangeProducts []string + + for _, info := range marketInfo { + exchangeProducts = append(exchangeProducts, info.ProductCode) + } + + err = b.UpdateAvailableCurrencies(exchangeProducts, false) if err != nil { - log.Printf("%s Failed to get available symbols.\n", b.GetName()) - } else { - var exchangeProducts []string - - for _, info := range marketInfo { - exchangeProducts = append(exchangeProducts, info.ProductCode) - } - - err = b.UpdateAvailableCurrencies(exchangeProducts, false) - if err != nil { - log.Printf("%s Failed to get config.\n", b.GetName()) - } + log.Printf("%s Failed to get config.\n", b.GetName()) } + } */ } @@ -136,26 +138,13 @@ func (b *Bitflyer) UpdateOrderbook(p currency.Pair, assetType string) (orderbook // GetAccountInfo retrieves balances for all enabled currencies on the // Bitflyer exchange func (b *Bitflyer) GetAccountInfo() (exchange.AccountInfo, error) { - var response exchange.AccountInfo - response.Exchange = b.GetName() - // accountBalance, err := b.GetAccountBalance() - // if err != nil { - // return response, err - // } - if !b.Enabled { - return response, errors.New("exchange not enabled") - } - - // implement once authenticated requests are introduced - - return response, nil + return exchange.AccountInfo{}, common.ErrNotYetImplemented } // GetFundingHistory returns funding history, deposits and // withdrawals func (b *Bitflyer) GetFundingHistory() ([]exchange.FundHistory, error) { - var fundHistory []exchange.FundHistory - return fundHistory, common.ErrFunctionNotSupported + return nil, common.ErrFunctionNotSupported } // GetExchangeHistory returns historic trade data since exchange opening. diff --git a/exchanges/websocket/wshandler/wshandler_test.go b/exchanges/websocket/wshandler/wshandler_test.go index 74b21ce6cac..f3699a8b8c9 100644 --- a/exchanges/websocket/wshandler/wshandler_test.go +++ b/exchanges/websocket/wshandler/wshandler_test.go @@ -202,7 +202,7 @@ func TestSubscriptionWithExistingEntry(t *testing.T) { w.SetChannelSubscriber(placeholderSubscriber) w.subscribeToChannels() if len(w.subscribedChannels) != 1 { - t.Errorf("Subscription should not have occured") + t.Errorf("Subscription should not have occurred") } } @@ -223,7 +223,7 @@ func TestUnsubscriptionWithExistingEntry(t *testing.T) { w.SetChannelUnsubscriber(placeholderSubscriber) w.unsubscribeToChannels() if len(w.subscribedChannels) != 1 { - t.Errorf("Unsubscription should not have occured") + t.Errorf("Unsubscription should not have occurred") } } diff --git a/exchanges/websocket/wsorderbook/wsorderbook_test.go b/exchanges/websocket/wsorderbook/wsorderbook_test.go index 6f4ddfef614..6aba611a48d 100644 --- a/exchanges/websocket/wsorderbook/wsorderbook_test.go +++ b/exchanges/websocket/wsorderbook/wsorderbook_test.go @@ -577,6 +577,6 @@ func TestSetup(t *testing.T) { w := WebsocketOrderbookLocal{} w.Setup(1, true, true, true, true, "hi") if w.obBufferLimit != 1 || !w.bufferEnabled || !w.sortBuffer || !w.sortBufferByUpdateIDs || !w.updateEntriesByID || w.exchangeName != "hi" { - t.Errorf("Setup incorrectly loaded %v", w) + t.Errorf("Setup incorrectly loaded %s", w.exchangeName) } } diff --git a/exchanges/zb/zb.go b/exchanges/zb/zb.go index 24b31a8bad6..d9a3e553999 100644 --- a/exchanges/zb/zb.go +++ b/exchanges/zb/zb.go @@ -176,7 +176,7 @@ func (z *ZB) SpotNewOrder(arg SpotNewOrderRequestParams) (int64, error) { return 0, err } if result.Code != 1000 { - return 0, fmt.Errorf("unsucessful new order, message: %s code: %d", result.Message, result.Code) + return 0, fmt.Errorf("unsuccessful new order, message: %s code: %d", result.Message, result.Code) } newOrderID, err := strconv.ParseInt(result.ID, 10, 64) if err != nil {