From c1f46438204fa0f00e35230d70d63f7d87ddd4f7 Mon Sep 17 00:00:00 2001 From: Kareem Mahlees Date: Sun, 4 Feb 2024 20:05:24 +0200 Subject: [PATCH] fix: lint errors --- internal/db/tables_test.go | 12 ++++++------ internal/rest/tableRoutes_test.go | 12 ++++++------ utils/testHelpers_test.go | 8 ++++++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/internal/db/tables_test.go b/internal/db/tables_test.go index 5ffe1c4..200e168 100644 --- a/internal/db/tables_test.go +++ b/internal/db/tables_test.go @@ -80,16 +80,16 @@ func (suite *TablesTestSuite) TearDownSuite() { func (suite *TablesTestSuite) BeforeTest(suiteName, testName string) { queryString := "CREATE TABLE test ( name varchar(255) );" - suite.sqliteConnection.Exec(queryString) - suite.pgConnection.Exec(queryString) - suite.mysqlConnection.Exec(queryString) + _, _ = suite.sqliteConnection.Exec(queryString) + _, _ = suite.pgConnection.Exec(queryString) + _, _ = suite.mysqlConnection.Exec(queryString) } func (suite *TablesTestSuite) AfterTest(suiteName, testName string) { queryString := "DROP TABLE test;" - suite.sqliteConnection.Exec(queryString) - suite.pgConnection.Exec(queryString) - suite.mysqlConnection.Exec(queryString) + _, _ = suite.sqliteConnection.Exec(queryString) + _, _ = suite.pgConnection.Exec(queryString) + _, _ = suite.mysqlConnection.Exec(queryString) } func (suite *TablesTestSuite) TestDescribeTable() { diff --git a/internal/rest/tableRoutes_test.go b/internal/rest/tableRoutes_test.go index 596ba9e..a64c032 100644 --- a/internal/rest/tableRoutes_test.go +++ b/internal/rest/tableRoutes_test.go @@ -83,16 +83,16 @@ func (suite *TableRoutesTestSuite) TearDownSuite() { func (suite *TableRoutesTestSuite) BeforeTest(suiteName, testName string) { queryString := "CREATE TABLE test ( name varchar(255) );" - suite.sqliteConnection.Exec(queryString) - suite.pgConnection.Exec(queryString) - suite.mysqlConnection.Exec(queryString) + _, _ = suite.sqliteConnection.Exec(queryString) + _, _ = suite.pgConnection.Exec(queryString) + _, _ = suite.mysqlConnection.Exec(queryString) } func (suite *TableRoutesTestSuite) AfterTest(suiteName, testName string) { queryString := "DROP TABLE test;" - suite.sqliteConnection.Exec(queryString) - suite.pgConnection.Exec(queryString) - suite.mysqlConnection.Exec(queryString) + _, _ = suite.sqliteConnection.Exec(queryString) + _, _ = suite.pgConnection.Exec(queryString) + _, _ = suite.mysqlConnection.Exec(queryString) } func (suite *TableRoutesTestSuite) TestRegisterTablesRoutes() { diff --git a/utils/testHelpers_test.go b/utils/testHelpers_test.go index 0a7c865..c03ed62 100644 --- a/utils/testHelpers_test.go +++ b/utils/testHelpers_test.go @@ -18,7 +18,9 @@ import ( func TestCreatePostgresContainer(t *testing.T) { ctx := context.Background() pgContainer, err := utils.CreatePostgresContainer(ctx) - defer pgContainer.Terminate(ctx) + defer func() { + _ = pgContainer.Terminate(ctx) + }() assert.Nil(t, err) @@ -34,7 +36,9 @@ func TestCreatePostgresContainer(t *testing.T) { func TestCreateMySQLContainer(t *testing.T) { ctx := context.Background() mysqlContainer, err := utils.CreateMySQLContainer(ctx) - defer mysqlContainer.Terminate(ctx) + defer func() { + _ = mysqlContainer.Terminate(ctx) + }() assert.Nil(t, err)