lint: fix linter issues

This commit is contained in:
Slyghtning 2026-03-05 12:18:05 +01:00
parent bb9124a80a
commit a10c741a26
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
54 changed files with 269 additions and 468 deletions

View file

@ -352,33 +352,33 @@ func (f *FSM) updateInstantOut(ctx context.Context,
}
// Infof logs an info message with the reservation hash as prefix.
func (f *FSM) Infof(format string, args ...interface{}) {
func (f *FSM) Infof(format string, args ...any) {
log.Infof(
"InstantOut %v: "+format,
append(
[]interface{}{f.InstantOut.swapPreimage.Hash()},
[]any{f.InstantOut.swapPreimage.Hash()},
args...,
)...,
)
}
// Debugf logs a debug message with the reservation hash as prefix.
func (f *FSM) Debugf(format string, args ...interface{}) {
func (f *FSM) Debugf(format string, args ...any) {
log.Debugf(
"InstantOut %v: "+format,
append(
[]interface{}{f.InstantOut.swapPreimage.Hash()},
[]any{f.InstantOut.swapPreimage.Hash()},
args...,
)...,
)
}
// Errorf logs an error message with the reservation hash as prefix.
func (f *FSM) Errorf(format string, args ...interface{}) {
func (f *FSM) Errorf(format string, args ...any) {
log.Errorf(
"InstantOut %v: "+format,
append(
[]interface{}{f.InstantOut.swapPreimage.Hash()},
[]any{f.InstantOut.swapPreimage.Hash()},
args...,
)...,
)

View file

@ -443,7 +443,7 @@ func (i *InstantOut) generateHtlcSweepTx(ctx context.Context,
// htlcWeight returns the weight for the htlc transaction.
func htlcWeight(numInputs int) lntypes.WeightUnit {
var weightEstimator input.TxWeightEstimator
for i := 0; i < numInputs; i++ {
for range numInputs {
weightEstimator.AddTaprootKeySpendInput(
txscript.SigHashDefault,
)
@ -457,7 +457,7 @@ func htlcWeight(numInputs int) lntypes.WeightUnit {
// sweeplessSweepWeight returns the weight for the sweepless sweep transaction.
func sweeplessSweepWeight(numInputs int) lntypes.WeightUnit {
var weightEstimator input.TxWeightEstimator
for i := 0; i < numInputs; i++ {
for range numInputs {
weightEstimator.AddTaprootKeySpendInput(
txscript.SigHashDefault,
)

View file

@ -259,26 +259,26 @@ func (r *FSM) updateReservation(ctx context.Context,
}
}
func (r *FSM) Infof(format string, args ...interface{}) {
func (r *FSM) Infof(format string, args ...any) {
log.Infof(
"Reservation %v %x: "+format,
append([]interface{}{r.reservation.ProtocolVersion, r.reservation.ID},
append([]any{r.reservation.ProtocolVersion, r.reservation.ID},
args...)...,
)
}
func (r *FSM) Debugf(format string, args ...interface{}) {
func (r *FSM) Debugf(format string, args ...any) {
log.Debugf(
"Reservation %v %x: "+format,
append([]interface{}{r.reservation.ProtocolVersion, r.reservation.ID},
append([]any{r.reservation.ProtocolVersion, r.reservation.ID},
args...)...,
)
}
func (r *FSM) Errorf(format string, args ...interface{}) {
func (r *FSM) Errorf(format string, args ...any) {
log.Errorf(
"Reservation %v %x: "+format,
append([]interface{}{r.reservation.ProtocolVersion, r.reservation.ID},
append([]any{r.reservation.ProtocolVersion, r.reservation.ID},
args...)...,
)
}

View file

@ -21,8 +21,7 @@ var (
)
func TestManager(t *testing.T) {
ctxb, cancel := context.WithCancel(context.Background())
defer cancel()
ctxb := t.Context()
testContext := newManagerTestContext(t)