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

@@ -1758,7 +1758,7 @@ func (s *RPCServer) WithdrawCryptocurrencyFunds(ctx context.Context, r *gctrpc.W
if exchCfg.API.Credentials.PIN != "" {
pinCode, errPin := strconv.ParseInt(exchCfg.API.Credentials.PIN, 10, 64)
if err != nil {
if errPin != nil {
return nil, errPin
}
req.PIN = pinCode
@@ -1815,12 +1815,12 @@ func (s *RPCServer) WithdrawFiatFunds(ctx context.Context, r *gctrpc.WithdrawFia
if exchCfg.API.Credentials.OTPSecret != "" {
code, errOTP := totp.GenerateCode(exchCfg.API.Credentials.OTPSecret, time.Now())
if err != nil {
if errOTP != nil {
return nil, errOTP
}
codeNum, errOTP := strconv.ParseInt(code, 10, 64)
if err != nil {
if errOTP != nil {
return nil, errOTP
}
req.OneTimePassword = codeNum
@@ -1828,7 +1828,7 @@ func (s *RPCServer) WithdrawFiatFunds(ctx context.Context, r *gctrpc.WithdrawFia
if exchCfg.API.Credentials.PIN != "" {
pinCode, errPIN := strconv.ParseInt(exchCfg.API.Credentials.PIN, 10, 64)
if err != nil {
if errPIN != nil {
return nil, errPIN
}
req.PIN = pinCode
@@ -4938,7 +4938,7 @@ func (s *RPCServer) GetCollateral(ctx context.Context, r *gctrpc.GetCollateralRe
}
tick, err = exch.FetchTicker(ctx, tickerCurr, asset.Spot)
if err != nil {
log.Errorf(log.GRPCSys, fmt.Sprintf("GetCollateral offline calculation error via FetchTicker %s %s", exch.GetName(), err))
log.Errorf(log.GRPCSys, "GetCollateral offline calculation error via FetchTicker %s %s", exch.GetName(), err)
continue
}
if tick.Last == 0 {