satisfy linter

This commit is contained in:
2026-10-12 14:30:28 +02:00
parent 79892bc55b
commit 4e77573223
10 changed files with 61 additions and 52 deletions

View File

@@ -19,6 +19,7 @@ package main
import (
"bytes"
"errors"
"fmt"
"io"
"log/slog"
@@ -63,6 +64,7 @@ func ScrapeUser(conf *Config) error {
panic(err)
}
}()
if err != nil {
return err
}
@@ -139,6 +141,7 @@ func ScrapeAd(conf *Config, uri string) error {
panic(err)
}
}()
if err != nil {
return err
}
@@ -156,7 +159,7 @@ func ScrapeAd(conf *Config, uri string) error {
if advertisement.Incomplete() {
slog.Debug("got ad", "ad", advertisement)
return fmt.Errorf("could not extract ad data from page, got empty struct")
return errors.New("could not extract ad data from page, got empty struct")
}
advertisement.DecodeAttributes()
@@ -206,7 +209,7 @@ func ScrapeImages(fetch *Fetcher, advertisement *Ad, addir string) error {
for _, imguri := range advertisement.Images {
// we append the suffix later in NewImage() based on image format
basefilename := filepath.Join(adpath, fmt.Sprintf("%d", img))
basefilename := filepath.Join(adpath, strconv.Itoa(img))
egroup.Go(func() error {
// wait a little
@@ -259,6 +262,7 @@ func ScrapeImages(fetch *Fetcher, advertisement *Ad, addir string) error {
return nil
})
img++
}