mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 15:10:46 +00:00
linter: Enable gofumpt and run against codebase (#1848)
* linter: Enable gofumpt and run against codebase * Address shazbert's nits * gofumpt: Fix issues after rebase
This commit is contained in:
@@ -150,7 +150,7 @@ func (b *BTSE) GetOHLCV(ctx context.Context, symbol string, start, end time.Time
|
||||
urlValues.Add("start", strconv.FormatInt(start.Unix(), 10))
|
||||
urlValues.Add("end", strconv.FormatInt(end.Unix(), 10))
|
||||
}
|
||||
var res = 60
|
||||
res := 60
|
||||
if resolution != 0 {
|
||||
res = resolution
|
||||
}
|
||||
|
||||
@@ -35,9 +35,11 @@ const (
|
||||
canManipulateRealOrders = false
|
||||
)
|
||||
|
||||
var b = &BTSE{}
|
||||
var futuresPair = currency.NewPair(currency.ENJ, currency.PFC)
|
||||
var spotPair = currency.NewPairWithDelimiter("BTC", "USD", "-")
|
||||
var (
|
||||
b = &BTSE{}
|
||||
futuresPair = currency.NewPair(currency.ENJ, currency.PFC)
|
||||
spotPair = currency.NewPairWithDelimiter("BTC", "USD", "-")
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
b.SetDefaults()
|
||||
@@ -285,7 +287,7 @@ func TestGetActiveOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, b)
|
||||
|
||||
var getOrdersRequest = order.MultiOrderRequest{
|
||||
getOrdersRequest := order.MultiOrderRequest{
|
||||
Pairs: []currency.Pair{
|
||||
{
|
||||
Delimiter: "-",
|
||||
@@ -311,7 +313,7 @@ func TestGetOrderHistory(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, b)
|
||||
|
||||
var getOrdersRequest = order.MultiOrderRequest{
|
||||
getOrdersRequest := order.MultiOrderRequest{
|
||||
Type: order.AnyType,
|
||||
AssetType: asset.Spot,
|
||||
Side: order.AnySide,
|
||||
@@ -405,7 +407,7 @@ func TestSubmitOrder(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, b, canManipulateRealOrders)
|
||||
|
||||
var orderSubmission = &order.Submit{
|
||||
orderSubmission := &order.Submit{
|
||||
Exchange: b.Name,
|
||||
Pair: currency.Pair{
|
||||
Base: currency.BTC,
|
||||
@@ -436,7 +438,7 @@ func TestCancelExchangeOrder(t *testing.T) {
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, b, canManipulateRealOrders)
|
||||
|
||||
// TODO: Place an order to make sure we can cancel it
|
||||
var orderCancellation = &order.Cancel{
|
||||
orderCancellation := &order.Cancel{
|
||||
OrderID: "b334ecef-2b42-4998-b8a4-b6b14f6d2671",
|
||||
WalletAddress: core.BitcoinDonationAddress,
|
||||
AccountID: "1",
|
||||
@@ -460,7 +462,7 @@ func TestCancelAllExchangeOrders(t *testing.T) {
|
||||
t.Parallel()
|
||||
sharedtestvalues.SkipTestIfCredentialsUnset(t, b, canManipulateRealOrders)
|
||||
|
||||
var orderCancellation = &order.Cancel{
|
||||
orderCancellation := &order.Cancel{
|
||||
OrderID: "1",
|
||||
WalletAddress: core.BitcoinDonationAddress,
|
||||
AccountID: "1",
|
||||
|
||||
@@ -248,7 +248,8 @@ func (b *BTSE) UpdateTickers(ctx context.Context, a asset.Item) error {
|
||||
High: tickers[x].High24Hr,
|
||||
OpenInterest: tickers[x].OpenInterest,
|
||||
ExchangeName: b.Name,
|
||||
AssetType: a})
|
||||
AssetType: a,
|
||||
})
|
||||
}
|
||||
if err != nil {
|
||||
errs = common.AppendError(errs, err)
|
||||
@@ -286,7 +287,8 @@ func (b *BTSE) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item)
|
||||
Volume: ticks[0].Volume,
|
||||
High: ticks[0].High24Hr,
|
||||
ExchangeName: b.Name,
|
||||
AssetType: a})
|
||||
AssetType: a,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -574,7 +576,7 @@ func (b *BTSE) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair
|
||||
continue
|
||||
}
|
||||
|
||||
var side = order.Buy
|
||||
side := order.Buy
|
||||
if strings.EqualFold(o[i].Side, order.Ask.String()) {
|
||||
side = order.Sell
|
||||
}
|
||||
@@ -732,7 +734,7 @@ func (b *BTSE) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest
|
||||
}
|
||||
|
||||
for i := range resp {
|
||||
var side = order.Buy
|
||||
side := order.Buy
|
||||
if strings.EqualFold(resp[i].Side, order.Ask.String()) {
|
||||
side = order.Sell
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user