From 637c223f0c09a0b69f6087b27ce46f020cc3c16d Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 20 Nov 2021 21:10:36 +0100 Subject: [PATCH] Problem: fmt.Sprintf was used with "%s" format Solution: use .String() instead --- pkg/rss/rss_2.0_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/rss/rss_2.0_test.go b/pkg/rss/rss_2.0_test.go index 69d53c9..55f61b0 100644 --- a/pkg/rss/rss_2.0_test.go +++ b/pkg/rss/rss_2.0_test.go @@ -1,7 +1,6 @@ package rss import ( - "fmt" "io/ioutil" "path/filepath" "testing" @@ -77,7 +76,7 @@ func TestParseItemDateOK(t *testing.T) { t.Fatalf("Parsing %s: %v", name, err) } - if fmt.Sprintf("%s", feed.Items[0].Date) != want { + if feed.Items[0].Date.String() != want { t.Errorf("%s: got %q, want %q", name, feed.Items[0].Date, want) } } @@ -100,7 +99,7 @@ func TestParseItemDateFailure(t *testing.T) { t.Fatalf("Parsing %s: %v", name, err) } - if fmt.Sprintf("%s", feed.Items[1].Date) != want { + if feed.Items[1].Date.String() != want { t.Errorf("%s: got %q, want %q", name, feed.Items[1].Date, want) }