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:
Adrian Gallagher
2025-03-18 10:23:16 +11:00
committed by GitHub
parent 748ed71455
commit f5faca2eb2
189 changed files with 1541 additions and 1104 deletions

View File

@@ -158,7 +158,8 @@ func (k *Kraken) FuturesEditOrder(ctx context.Context, orderID, clientOrderID st
// FuturesSendOrder sends a futures order
func (k *Kraken) FuturesSendOrder(ctx context.Context, orderType order.Type, symbol currency.Pair, side, triggerSignal, clientOrderID, reduceOnly string,
ioc bool,
size, limitPrice, stopPrice float64) (FuturesSendOrderData, error) {
size, limitPrice, stopPrice float64,
) (FuturesSendOrderData, error) {
var resp FuturesSendOrderData
if ioc && orderType != order.Market {

View File

@@ -549,7 +549,7 @@ func setFeeBuilder() *exchange.FeeBuilder {
// TestGetFeeByTypeOfflineTradeFee logic test
func TestGetFeeByTypeOfflineTradeFee(t *testing.T) {
t.Parallel()
var feeBuilder = setFeeBuilder()
feeBuilder := setFeeBuilder()
f, err := k.GetFeeByType(context.Background(), feeBuilder)
require.NoError(t, err, "GetFeeByType must not error")
assert.Positive(t, f, "GetFeeByType should return a positive value")
@@ -563,7 +563,7 @@ func TestGetFeeByTypeOfflineTradeFee(t *testing.T) {
// TestGetFee exercises GetFee
func TestGetFee(t *testing.T) {
t.Parallel()
var feeBuilder = setFeeBuilder()
feeBuilder := setFeeBuilder()
if sharedtestvalues.AreAPICredentialsSet(k) {
_, err := k.GetFee(context.Background(), feeBuilder)
@@ -628,7 +628,7 @@ func TestGetActiveOrders(t *testing.T) {
t.Parallel()
sharedtestvalues.SkipTestIfCredentialsUnset(t, k)
var getOrdersRequest = order.MultiOrderRequest{
getOrdersRequest := order.MultiOrderRequest{
Type: order.AnyType,
AssetType: asset.Spot,
Pairs: currency.Pairs{spotTestPair},
@@ -644,7 +644,7 @@ func TestGetOrderHistory(t *testing.T) {
t.Parallel()
sharedtestvalues.SkipTestIfCredentialsUnset(t, k)
var getOrdersRequest = order.MultiOrderRequest{
getOrdersRequest := order.MultiOrderRequest{
Type: order.AnyType,
AssetType: asset.Spot,
Side: order.AnySide,
@@ -670,7 +670,7 @@ func TestSubmitOrder(t *testing.T) {
t.Parallel()
sharedtestvalues.SkipTestIfCannotManipulateOrders(t, k, canManipulateRealOrders)
var orderSubmission = &order.Submit{
orderSubmission := &order.Submit{
Exchange: k.Name,
Pair: spotTestPair,
Side: order.Buy,
@@ -701,7 +701,7 @@ func TestCancelExchangeOrder(t *testing.T) {
sharedtestvalues.SkipTestIfCannotManipulateOrders(t, k, canManipulateRealOrders)
var orderCancellation = &order.Cancel{
orderCancellation := &order.Cancel{
OrderID: "OGEX6P-B5Q74-IGZ72R",
AssetType: asset.Spot,
}
@@ -804,7 +804,7 @@ func TestWithdrawFiat(t *testing.T) {
t.Parallel()
sharedtestvalues.SkipTestIfCannotManipulateOrders(t, k, canManipulateRealOrders)
var withdrawFiatRequest = withdraw.Request{
withdrawFiatRequest := withdraw.Request{
Amount: -1,
Currency: currency.EUR,
Description: "WITHDRAW IT ALL",
@@ -825,7 +825,7 @@ func TestWithdrawInternationalBank(t *testing.T) {
t.Parallel()
sharedtestvalues.SkipTestIfCannotManipulateOrders(t, k, canManipulateRealOrders)
var withdrawFiatRequest = withdraw.Request{
withdrawFiatRequest := withdraw.Request{
Amount: -1,
Currency: currency.EUR,
Description: "WITHDRAW IT ALL",

View File

@@ -513,7 +513,6 @@ type WebsocketSubscriptionData struct {
Interval int `json:"interval,omitempty"` // Optional - Timeframe for candles subscription in minutes; default 1. Valid: 1|5|15|30|60|240|1440|10080|21600
Depth int `json:"depth,omitempty"` // Optional - Depth associated with orderbook; default 10. Valid: 10|25|100|500|1000
Token string `json:"token,omitempty"` // Optional - Token for authenticated channels
}
// WebsocketEventResponse holds all data response types