Bump golangci-lint to v1.18.0 (#354)

* Bump golangci-lint to v0.18.0

* Bump AppVeyor golangci-lint to v1.18

For science

* Bump golangci deadline

* Fix notifications typo

* Fix grammar

* Update DisableNTPCheck test string comparison
This commit is contained in:
Adrian Gallagher
2019-09-13 13:36:52 +10:00
committed by GitHub
parent 3bcaa5db96
commit b1ed894d99
16 changed files with 98 additions and 105 deletions

View File

@@ -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)
}

View File

@@ -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()
if err != nil {
log.Printf("%s Failed to get available symbols.\n", b.GetName())
} else {
var exchangeProducts []string
/* nolint: gocritic
This has been disabled in master but enabled in engine due to multiple
asset support
for _, info := range marketInfo {
exchangeProducts = append(exchangeProducts, info.ProductCode)
}
marketInfo, err := b.GetMarkets()
if err != nil {
log.Printf("%s Failed to get available symbols.\n", b.GetName())
} else {
var exchangeProducts []string
err = b.UpdateAvailableCurrencies(exchangeProducts, false)
if err != nil {
log.Printf("%s Failed to get config.\n", b.GetName())
}
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())
}
}
*/
}
@@ -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.

View File

@@ -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")
}
}

View File

@@ -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)
}
}

View File

@@ -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 {