CI/build: Update Go version, linters and fix minor issues (#1612)

* CI/build: Update Go version, linters and fix minor issues

* linters: Add intrange, copyloopvar, additional go vet linters to match gopls and fix issues
This commit is contained in:
Adrian Gallagher
2024-08-16 17:41:11 +10:00
committed by GitHub
parent facf291069
commit 225429bda6
111 changed files with 239 additions and 379 deletions

View File

@@ -708,14 +708,8 @@ func (b *Bithumb) FetchExchangeLimits(ctx context.Context) ([]order.MinMaxLevel,
limits := make([]order.MinMaxLevel, 0, len(ticks))
for code, data := range ticks {
c := currency.NewCode(code)
cp := currency.NewPair(c, currency.KRW)
if err != nil {
return nil, err
}
limits = append(limits, order.MinMaxLevel{
Pair: cp,
Pair: currency.NewPair(currency.NewCode(code), currency.KRW),
Asset: asset.Spot,
MinimumBaseAmount: getAmountMinimum(data.ClosingPrice),
})

View File

@@ -643,8 +643,7 @@ func TestGetAmountMinimum(t *testing.T) {
},
}
for i := range testCases {
tt := &testCases[i]
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
minAmount := getAmountMinimum(tt.unitprice)

View File

@@ -262,7 +262,7 @@ var WithdrawalFees = map[currency.Code]float64{
currency.LRC: 10,
currency.GTO: 15,
currency.STEEM: 0.01,
currency.STRAT: 0.2,
currency.STRAT: 0.2, //nolint:misspell // Not a misspelling
currency.PPT: 0.5,
currency.CTXC: 4,
currency.CMT: 20,

View File

@@ -195,7 +195,7 @@ func (b *Bithumb) setupOrderbookManager() {
}
}
for i := 0; i < maxWSOrderbookWorkers; i++ {
for range maxWSOrderbookWorkers {
// 10 workers for synchronising book
b.SynchroniseWebsocketOrderbook()
}