From fbeb05c61be1a6a057780817491c998ec11abc0d Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 24 May 2024 18:46:29 +0900 Subject: [PATCH] fix: fix vet err --- node/pkg/fetcher/app_test.go | 12 ++++++------ node/pkg/fetcher/fetcher_test.go | 12 ++++++------ node/pkg/fetcher/utils_test.go | 7 +++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/node/pkg/fetcher/app_test.go b/node/pkg/fetcher/app_test.go index f837f862d..03ded4120 100644 --- a/node/pkg/fetcher/app_test.go +++ b/node/pkg/fetcher/app_test.go @@ -85,15 +85,15 @@ func TestAppRun(t *testing.T) { for _, fetcher := range app.Fetchers { for _, feed := range fetcher.Feeds { - result, err := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID))) - if err != nil { - t.Fatalf("error getting latest feed data: %v", err) + result, letestFeedDataErr := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID))) + if letestFeedDataErr != nil { + t.Fatalf("error getting latest feed data: %v", letestFeedDataErr) } assert.NotNil(t, result) } - rdbResult, err := db.Get(ctx, "localAggregate:"+strconv.Itoa(int(fetcher.Config.ID))) - if err != nil { - t.Fatalf("error getting local aggregate: %v", err) + rdbResult, localAggregateErr := db.Get(ctx, "localAggregate:"+strconv.Itoa(int(fetcher.Config.ID))) + if localAggregateErr != nil { + t.Fatalf("error getting local aggregate: %v", localAggregateErr) } assert.NotNil(t, rdbResult) } diff --git a/node/pkg/fetcher/fetcher_test.go b/node/pkg/fetcher/fetcher_test.go index 09c60bb46..c3db84ecd 100644 --- a/node/pkg/fetcher/fetcher_test.go +++ b/node/pkg/fetcher/fetcher_test.go @@ -77,18 +77,18 @@ func TestFetcherFetcherJob(t *testing.T) { } for _, fetcher := range app.Fetchers { - err := fetcher.fetcherJob(ctx, app.ChainHelpers, app.Proxies) - if err != nil { - t.Fatalf("error fetching: %v", err) + jobErr := fetcher.fetcherJob(ctx, app.ChainHelpers, app.Proxies) + if jobErr != nil { + t.Fatalf("error fetching: %v", jobErr) } } defer db.Del(ctx, "feedDataBuffer") for _, fetcher := range app.Fetchers { for _, feed := range fetcher.Feeds { - res, err := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID))) - if err != nil { - t.Fatalf("error fetching feed data: %v", err) + res, latestFeedDataErr := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID))) + if latestFeedDataErr != nil { + t.Fatalf("error fetching feed data: %v", latestFeedDataErr) } assert.NotNil(t, res) defer db.Del(ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID))) diff --git a/node/pkg/fetcher/utils_test.go b/node/pkg/fetcher/utils_test.go index 0b084d169..5d589f152 100644 --- a/node/pkg/fetcher/utils_test.go +++ b/node/pkg/fetcher/utils_test.go @@ -270,10 +270,9 @@ func TestInsertLocalAggregatePgsql(t *testing.T) { configs := testItems.insertedConfigs for i, config := range configs { - - err := insertLocalAggregatePgsql(ctx, config.Id, float64(i)+5) - if err != nil { - t.Fatalf("error inserting local aggregate pgsql: %v", err) + insertLocalAggregateErr := insertLocalAggregatePgsql(ctx, config.Id, float64(i)+5) + if insertLocalAggregateErr != nil { + t.Fatalf("error inserting local aggregate pgsql: %v", insertLocalAggregateErr) } }