From 7fff56c7585b370afd1fdb14def3329f65ee92e2 Mon Sep 17 00:00:00 2001 From: Aleksandr Dubovikov Date: Wed, 9 Oct 2024 20:44:12 +0200 Subject: [PATCH] fix linter errors Signed-off-by: Aleksandr Dubovikov --- mediaapi/routing/url_preview_test.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/mediaapi/routing/url_preview_test.go b/mediaapi/routing/url_preview_test.go index 08dc4da59..6c531e6e8 100644 --- a/mediaapi/routing/url_preview_test.go +++ b/mediaapi/routing/url_preview_test.go @@ -1,7 +1,6 @@ package routing import ( - "bytes" "context" "fmt" "io" @@ -72,17 +71,6 @@ func Test_getMetaFieldsFromHTML(t *testing.T) { } func Test_LoadStorePreview(t *testing.T) { - type fields struct { - MediaMetadata *types.MediaMetadata - Logger *log.Entry - } - type args struct { - ctx context.Context - reqReader io.Reader - cfg *config.MediaAPI - db storage.Database - activeThumbnailGeneration *types.ActiveThumbnailGeneration - } wd, err := os.Getwd() if err != nil { @@ -242,8 +230,6 @@ func Test_UrlPreviewHandler(t *testing.T) { } maxSize := config.FileSizeBytes(1024 * 1024) - logger := log.New().WithField("mediaapi", "test") - logger.Debug("some") testdataPath := filepath.Join(wd, "./testdata") g := &config.Global{} @@ -281,13 +267,13 @@ func Test_UrlPreviewHandler(t *testing.T) { if err != nil { t.Errorf("error opening mediaapi database: %v", err) } - db2, err := storage.NewMediaAPIDatasource(cm, &config.DatabaseOptions{ + db2, err2 := storage.NewMediaAPIDatasource(cm, &config.DatabaseOptions{ ConnectionString: "file::memory:", MaxOpenConnections: 100, MaxIdleConnections: 2, ConnMaxLifetimeSeconds: -1, }) - if err != nil { + if err2 != nil { t.Errorf("error opening mediaapi database: %v", err) } @@ -306,7 +292,6 @@ func Test_UrlPreviewHandler(t *testing.T) { // this handler is to test image resize handler3 := makeUrlPreviewHandler(cfg2, rateLimits, db2, activeThumbnailGeneration) - data := bytes.Buffer{} responseBody := ` Title @@ -317,7 +302,6 @@ func Test_UrlPreviewHandler(t *testing.T) { ` - data.WriteString(responseBody) srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.RequestURI == "/test.png" || r.RequestURI == "/test2.png" {