From 83254a1f2663a229d5540b59e7c7c25d023c84bf Mon Sep 17 00:00:00 2001 From: gudvinr Date: Mon, 18 Aug 2025 23:10:18 +0300 Subject: [PATCH] refactor(model): replace Sprintf("%d") in tests This is just Itoa but weird. --- internal/model/feed_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/model/feed_test.go b/internal/model/feed_test.go index d6887a93..43e13327 100644 --- a/internal/model/feed_test.go +++ b/internal/model/feed_test.go @@ -4,8 +4,8 @@ package model // import "miniflux.app/v2/internal/model" import ( - "fmt" "os" + "strconv" "testing" "time" @@ -171,7 +171,7 @@ func TestFeedScheduleNextCheckRoundRobinMinInterval(t *testing.T) { minInterval := 1 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "round_robin") - os.Setenv("SCHEDULER_ROUND_ROBIN_MIN_INTERVAL", fmt.Sprintf("%d", minInterval)) + os.Setenv("SCHEDULER_ROUND_ROBIN_MIN_INTERVAL", strconv.Itoa(minInterval)) var err error parser := config.NewParser() @@ -197,8 +197,8 @@ func TestFeedScheduleNextCheckEntryFrequencyMaxInterval(t *testing.T) { minInterval := 1 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "entry_frequency") - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", fmt.Sprintf("%d", maxInterval)) - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", fmt.Sprintf("%d", minInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", strconv.Itoa(maxInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", strconv.Itoa(minInterval)) var err error parser := config.NewParser() @@ -226,8 +226,8 @@ func TestFeedScheduleNextCheckEntryFrequencyMaxIntervalZeroWeeklyCount(t *testin minInterval := 1 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "entry_frequency") - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", fmt.Sprintf("%d", maxInterval)) - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", fmt.Sprintf("%d", minInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", strconv.Itoa(maxInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", strconv.Itoa(minInterval)) var err error parser := config.NewParser() @@ -255,8 +255,8 @@ func TestFeedScheduleNextCheckEntryFrequencyMinInterval(t *testing.T) { minInterval := 100 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "entry_frequency") - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", fmt.Sprintf("%d", maxInterval)) - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", fmt.Sprintf("%d", minInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", strconv.Itoa(maxInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", strconv.Itoa(minInterval)) var err error parser := config.NewParser() @@ -283,7 +283,7 @@ func TestFeedScheduleNextCheckEntryFrequencyFactor(t *testing.T) { factor := 2 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "entry_frequency") - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_FACTOR", fmt.Sprintf("%d", factor)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_FACTOR", strconv.Itoa(factor)) var err error parser := config.NewParser() @@ -311,8 +311,8 @@ func TestFeedScheduleNextCheckEntryFrequencySmallNewTTL(t *testing.T) { minInterval := 100 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "entry_frequency") - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", fmt.Sprintf("%d", maxInterval)) - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", fmt.Sprintf("%d", minInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", strconv.Itoa(maxInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", strconv.Itoa(minInterval)) var err error parser := config.NewParser() @@ -347,8 +347,8 @@ func TestFeedScheduleNextCheckEntryFrequencyLargeNewTTL(t *testing.T) { minInterval := 100 os.Clearenv() os.Setenv("POLLING_SCHEDULER", "entry_frequency") - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", fmt.Sprintf("%d", maxInterval)) - os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", fmt.Sprintf("%d", minInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MAX_INTERVAL", strconv.Itoa(maxInterval)) + os.Setenv("SCHEDULER_ENTRY_FREQUENCY_MIN_INTERVAL", strconv.Itoa(minInterval)) var err error parser := config.NewParser()