Lint in CI

This commit is contained in:
Neil Alexander
2025-12-20 14:06:14 +00:00
parent 0fe5375737
commit fa32249f2f
10 changed files with 52 additions and 27 deletions

View File

@@ -86,7 +86,7 @@ func (w *Writer) Do(db *sql.DB, txn *sql.Tx, f func(txn *sql.Tx) error) error {
}
func (w *Writer) run() {
if !w.running.CAS(false, true) {
if !w.running.CompareAndSwap(false, true) {
return
}
defer w.running.Store(false)

View File

@@ -110,7 +110,7 @@ func (t *TableMailboxes) MailboxList(onlySubscribed bool) ([]string, error) {
if err != nil {
return nil, fmt.Errorf("t.listMailboxes.Query: %w", err)
}
defer rows.Close()
defer rows.Close() // nolint:errcheck
var mailboxes []string
for rows.Next() {
var mailbox string

View File

@@ -200,7 +200,7 @@ func (t *TableMails) MailSearch(mailbox string) ([]uint32, error) {
if err != nil {
return nil, fmt.Errorf("t.searchMail.Query: %w", err)
}
defer rows.Close()
defer rows.Close() // nolint:errcheck
for rows.Next() {
var id uint32
if err := rows.Scan(&id); err != nil {

View File

@@ -98,7 +98,7 @@ func (t *TableQueue) QueueListDestinations() ([]string, error) {
}
return nil, fmt.Errorf("t.queueSelectDestinations.Query: %w", err)
}
defer rows.Close()
defer rows.Close() // nolint:errcheck
var destinations []string
for rows.Next() {
var destination string
@@ -118,7 +118,7 @@ func (t *TableQueue) QueueMailIDsForDestination(destination string) ([]types.Que
}
return nil, fmt.Errorf("t.queueSelectDestinations.Query: %w", err)
}
defer rows.Close()
defer rows.Close() // nolint:errcheck
var ids []types.QueuedMail
for rows.Next() {
var id int