linter: fix lint issues after linter v2 update

This commit is contained in:
Slyghtning
2025-08-19 16:13:51 +02:00
parent d4884d5aee
commit 536bc0d241
6 changed files with 10 additions and 9 deletions

View File

@@ -165,7 +165,7 @@ func (t *TransactionExecutor[Q]) ExecTx(ctx context.Context,
for i := 0; i < t.opts.numRetries; i++ { for i := 0; i < t.opts.numRetries; i++ {
// Create the db transaction. // Create the db transaction.
tx, err := t.BatchedQuerier.BeginTx(ctx, txOptions) tx, err := t.BeginTx(ctx, txOptions)
if err != nil { if err != nil {
return err return err
} }

View File

@@ -167,7 +167,7 @@ func NewTestSqliteDB(t *testing.T) *SqliteStore {
require.NoError(t, err) require.NoError(t, err)
t.Cleanup(func() { t.Cleanup(func() {
require.NoError(t, sqlDB.DB.Close()) require.NoError(t, sqlDB.Close())
}) })
return sqlDB return sqlDB

View File

@@ -366,6 +366,7 @@ func (l *LndChallenger) VerifyInvoiceStatus(hash lntypes.Hash,
// Block here until our condition is met or the allowed time is // Block here until our condition is met or the allowed time is
// up. The Wait() will return whenever a signal is broadcast. // up. The Wait() will return whenever a signal is broadcast.
invoiceState, hasInvoice = l.invoiceStates[hash] invoiceState, hasInvoice = l.invoiceStates[hash]
//nolint:staticcheck
for !(hasInvoice && invoiceState == state) && !timeoutReached { for !(hasInvoice && invoiceState == state) && !timeoutReached {
l.invoicesCond.Wait() l.invoicesCond.Wait()

View File

@@ -81,9 +81,9 @@ func NewMockLnd() *LndMockServices {
// Also simulate the cached info that is loaded on startup. // Also simulate the cached info that is loaded on startup.
info, _ := lightningClient.GetInfo(context.Background()) info, _ := lightningClient.GetInfo(context.Background())
version, _ := versioner.GetVersion(context.Background()) version, _ := versioner.GetVersion(context.Background())
lnd.LndServices.NodeAlias = info.Alias lnd.NodeAlias = info.Alias
lnd.LndServices.NodePubkey = info.IdentityPubkey lnd.LndServices.NodePubkey = info.IdentityPubkey
lnd.LndServices.Version = version lnd.Version = version
lnd.WaitForFinished = func() { lnd.WaitForFinished = func() {
chainNotifier.WaitForFinished() chainNotifier.WaitForFinished()

View File

@@ -38,7 +38,7 @@ func newOnionStore(client *clientv3.Client) *onionStore {
// StorePrivateKey stores the given private key. // StorePrivateKey stores the given private key.
func (s *onionStore) StorePrivateKey(privateKey []byte) error { func (s *onionStore) StorePrivateKey(privateKey []byte) error {
_, err := s.Client.Put(context.Background(), onionPath, string(privateKey)) _, err := s.Put(context.Background(), onionPath, string(privateKey))
return err return err
} }
@@ -58,6 +58,6 @@ func (s *onionStore) PrivateKey() ([]byte, error) {
// DeletePrivateKey securely removes the private key from the store. // DeletePrivateKey securely removes the private key from the store.
func (s *onionStore) DeletePrivateKey() error { func (s *onionStore) DeletePrivateKey() error {
_, err := s.Client.Delete(context.Background(), onionPath) _, err := s.Delete(context.Background(), onionPath)
return err return err
} }

View File

@@ -200,12 +200,12 @@ func prepareServices(services []*Service) error {
// There are two supported formats to encode the file // There are two supported formats to encode the file
// content in: hex and base64. // content in: hex and base64.
switch { switch prefix {
case prefix == filePrefixHex: case filePrefixHex:
newValue := hex.EncodeToString(bytes) newValue := hex.EncodeToString(bytes)
service.Headers[key] = newValue service.Headers[key] = newValue
case prefix == filePrefixBase64: case filePrefixBase64:
newValue := base64.StdEncoding.EncodeToString( newValue := base64.StdEncoding.EncodeToString(
bytes, bytes,
) )