From 542c244ca29094a1b4f1eb17666b03741ce91bb4 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:25:59 -0500 Subject: [PATCH] chore: fixing code lint issues (#999) --- api/build/graph.go | 3 +- api/metrics.go | 1 - database/build/build_test.go | 2 +- database/database.go | 1 + database/log/log_test.go | 2 +- database/pipeline/pipeline_test.go | 2 +- database/repo/repo_test.go | 2 +- database/user/user_test.go | 2 +- internal/token/refresh_test.go | 4 +- router/middleware/build/build_test.go | 10 +-- router/middleware/claims/claims_test.go | 2 +- router/middleware/logger.go | 3 + router/middleware/org/org_test.go | 2 +- router/middleware/perm/perm_test.go | 88 ++++++++++----------- router/middleware/pipeline/pipeline_test.go | 10 +-- router/middleware/repo/repo_test.go | 2 +- router/middleware/service/service_test.go | 20 ++--- router/middleware/step/step_test.go | 20 ++--- router/middleware/user/user_test.go | 2 +- router/middleware/worker/worker_test.go | 2 +- secret/native/count_test.go | 2 +- secret/native/create_test.go | 8 +- secret/native/delete_test.go | 2 +- secret/native/get_test.go | 2 +- secret/native/list_test.go | 4 +- secret/native/update_test.go | 2 +- 26 files changed, 102 insertions(+), 98 deletions(-) diff --git a/api/build/graph.go b/api/build/graph.go index c93cefa90..40eeabf70 100644 --- a/api/build/graph.go +++ b/api/build/graph.go @@ -131,7 +131,7 @@ const ( // GetBuildGraph represents the API handler to capture a // directed a-cyclical graph for a build from the configured backend. // -//nolint:funlen,goconst // ignore function length and constants +//nolint:funlen,goconst,gocyclo // ignore function length and constants func GetBuildGraph(c *gin.Context) { // capture middleware values b := build.Retrieve(c) @@ -425,6 +425,7 @@ func GetBuildGraph(c *gin.Context) { if stage.Name == "init" { cluster = BuiltInCluster } + if stage.Name == "clone" { cluster = BuiltInCluster } diff --git a/api/metrics.go b/api/metrics.go index 0cadb75d3..b3dbbeb9f 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -442,7 +442,6 @@ func recordGauges(c *gin.Context) { } // check if the worker checked in within the last worker_active_interval if worker.GetLastCheckedIn() >= before { - switch worker.GetStatus() { case constants.WorkerStatusIdle: idleWorkers++ diff --git a/database/build/build_test.go b/database/build/build_test.go index d232aed78..3babca2eb 100644 --- a/database/build/build_test.go +++ b/database/build/build_test.go @@ -268,7 +268,7 @@ func testRepo() *library.Repo { type AnyArgument struct{} // Match satisfies sqlmock.Argument interface. -func (a AnyArgument) Match(v driver.Value) bool { +func (a AnyArgument) Match(_ driver.Value) bool { return true } diff --git a/database/database.go b/database/database.go index 844eeb2f9..d4d31e228 100644 --- a/database/database.go +++ b/database/database.go @@ -80,6 +80,7 @@ type ( // // * postgres // * sqlite3 +// . func New(opts ...EngineOpt) (Interface, error) { // create new database engine e := new(engine) diff --git a/database/log/log_test.go b/database/log/log_test.go index bb813b203..f8b5bcadf 100644 --- a/database/log/log_test.go +++ b/database/log/log_test.go @@ -174,7 +174,7 @@ func testSqlite(t *testing.T) *engine { type AnyArgument struct{} // Match satisfies sqlmock.Argument interface. -func (a AnyArgument) Match(v driver.Value) bool { +func (a AnyArgument) Match(_ driver.Value) bool { return true } diff --git a/database/pipeline/pipeline_test.go b/database/pipeline/pipeline_test.go index a0041554e..01582a62a 100644 --- a/database/pipeline/pipeline_test.go +++ b/database/pipeline/pipeline_test.go @@ -204,6 +204,6 @@ func testPipeline() *library.Pipeline { type AnyArgument struct{} // Match satisfies sqlmock.Argument interface. -func (a AnyArgument) Match(v driver.Value) bool { +func (a AnyArgument) Match(_ driver.Value) bool { return true } diff --git a/database/repo/repo_test.go b/database/repo/repo_test.go index b7514f62a..f2cf224b9 100644 --- a/database/repo/repo_test.go +++ b/database/repo/repo_test.go @@ -208,6 +208,6 @@ func testRepo() *library.Repo { type AnyArgument struct{} // Match satisfies sqlmock.Argument interface. -func (a AnyArgument) Match(v driver.Value) bool { +func (a AnyArgument) Match(_ driver.Value) bool { return true } diff --git a/database/user/user_test.go b/database/user/user_test.go index 8978f28ea..a3ab4ff11 100644 --- a/database/user/user_test.go +++ b/database/user/user_test.go @@ -193,6 +193,6 @@ func testUser() *library.User { type AnyArgument struct{} // Match satisfies sqlmock.Argument interface. -func (a AnyArgument) Match(v driver.Value) bool { +func (a AnyArgument) Match(_ driver.Value) bool { return true } diff --git a/internal/token/refresh_test.go b/internal/token/refresh_test.go index dcc167bda..6618b88c9 100644 --- a/internal/token/refresh_test.go +++ b/internal/token/refresh_test.go @@ -51,7 +51,7 @@ func TestTokenManager_Refresh(t *testing.T) { } defer func() { - db.DeleteUser(context.TODO(), u) + _ = db.DeleteUser(context.TODO(), u) db.Close() }() @@ -112,7 +112,7 @@ func TestTokenManager_Refresh_Expired(t *testing.T) { } defer func() { - db.DeleteUser(context.TODO(), u) + _ = db.DeleteUser(context.TODO(), u) db.Close() }() diff --git a/router/middleware/build/build_test.go b/router/middleware/build/build_test.go index fb31a04d7..d3e82a24e 100644 --- a/router/middleware/build/build_test.go +++ b/router/middleware/build/build_test.go @@ -88,8 +88,8 @@ func TestBuild_Establish(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), want) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), want) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -171,7 +171,7 @@ func TestBuild_Establish_NoBuildParameter(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -219,7 +219,7 @@ func TestBuild_Establish_InvalidBuildParameter(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -267,7 +267,7 @@ func TestBuild_Establish_NoBuild(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() diff --git a/router/middleware/claims/claims_test.go b/router/middleware/claims/claims_test.go index 02287049d..2eb89b3bd 100644 --- a/router/middleware/claims/claims_test.go +++ b/router/middleware/claims/claims_test.go @@ -273,7 +273,7 @@ func TestClaims_Establish_BadToken(t *testing.T) { } defer func() { - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() diff --git a/router/middleware/logger.go b/router/middleware/logger.go index 8cc6f4275..57bc11253 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -134,12 +134,14 @@ func (f *ECSFormatter) Format(e *logrus.Entry) ([]byte, error) { if f.DataKey != "" { datahint = 2 } + data := make(logrus.Fields, datahint) if len(e.Data) > 0 { extraData := data if f.DataKey != "" { extraData = make(logrus.Fields, len(e.Data)) } + for k, v := range e.Data { switch k { case "ip": @@ -160,6 +162,7 @@ func (f *ECSFormatter) Format(e *logrus.Entry) ([]byte, error) { extraData[k] = v } } + if f.DataKey != "" && len(extraData) > 0 { data[f.DataKey] = extraData } diff --git a/router/middleware/org/org_test.go b/router/middleware/org/org_test.go index 7319aa4c6..27021222f 100644 --- a/router/middleware/org/org_test.go +++ b/router/middleware/org/org_test.go @@ -64,7 +64,7 @@ func TestOrg_Establish(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index f27b50b15..c2c9642e4 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -58,7 +58,7 @@ func TestPerm_MustPlatformAdmin(t *testing.T) { } defer func() { - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -146,7 +146,7 @@ func TestPerm_MustPlatformAdmin_NotAdmin(t *testing.T) { } defer func() { - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -273,7 +273,7 @@ func TestPerm_MustWorkerRegisterToken_PlatAdmin(t *testing.T) { } defer func() { - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -443,8 +443,8 @@ func TestPerm_MustBuildAccess(t *testing.T) { ctx := _context.TODO() defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) db.Close() }() @@ -534,9 +534,9 @@ func TestPerm_MustBuildAccess_PlatAdmin(t *testing.T) { } defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -622,8 +622,8 @@ func TestPerm_MustBuildToken_WrongBuild(t *testing.T) { } defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) db.Close() }() @@ -708,8 +708,8 @@ func TestPerm_MustSecretAdmin_BuildToken_Repo(t *testing.T) { } defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) db.Close() }() @@ -791,8 +791,8 @@ func TestPerm_MustSecretAdmin_BuildToken_Org(t *testing.T) { } defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) db.Close() }() @@ -874,8 +874,8 @@ func TestPerm_MustSecretAdmin_BuildToken_Shared(t *testing.T) { } defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) db.Close() }() @@ -955,8 +955,8 @@ func TestPerm_MustAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1053,8 +1053,8 @@ func TestPerm_MustAdmin_PlatAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1151,8 +1151,8 @@ func TestPerm_MustAdmin_NotAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1249,8 +1249,8 @@ func TestPerm_MustWrite(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1347,8 +1347,8 @@ func TestPerm_MustWrite_PlatAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1445,8 +1445,8 @@ func TestPerm_MustWrite_RepoAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1543,8 +1543,8 @@ func TestPerm_MustWrite_NotWrite(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1641,8 +1641,8 @@ func TestPerm_MustRead(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1739,8 +1739,8 @@ func TestPerm_MustRead_PlatAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -1839,8 +1839,8 @@ func TestPerm_MustRead_WorkerBuildToken(t *testing.T) { } defer func() { - db.DeleteBuild(ctx, b) - db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteBuild(ctx, b) + _ = db.DeleteRepo(_context.TODO(), r) db.Close() }() @@ -1923,8 +1923,8 @@ func TestPerm_MustRead_RepoAdmin(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -2021,8 +2021,8 @@ func TestPerm_MustRead_RepoWrite(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -2119,8 +2119,8 @@ func TestPerm_MustRead_RepoPublic(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() @@ -2217,8 +2217,8 @@ func TestPerm_MustRead_NotRead(t *testing.T) { } defer func() { - db.DeleteRepo(_context.TODO(), r) - db.DeleteUser(_context.TODO(), u) + _ = db.DeleteRepo(_context.TODO(), r) + _ = db.DeleteUser(_context.TODO(), u) db.Close() }() diff --git a/router/middleware/pipeline/pipeline_test.go b/router/middleware/pipeline/pipeline_test.go index 80df22009..545edb338 100644 --- a/router/middleware/pipeline/pipeline_test.go +++ b/router/middleware/pipeline/pipeline_test.go @@ -101,8 +101,8 @@ func TestPipeline_Establish(t *testing.T) { } defer func() { - db.DeletePipeline(context.TODO(), want) - db.DeleteRepo(context.TODO(), r) + _ = db.DeletePipeline(context.TODO(), want) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -184,7 +184,7 @@ func TestPipeline_Establish_NoPipelineParameter(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -287,8 +287,8 @@ func TestPipeline_Establish_NoPipeline(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) - db.DeleteUser(context.TODO(), u) + _ = db.DeleteRepo(context.TODO(), r) + _ = db.DeleteUser(context.TODO(), u) db.Close() }() diff --git a/router/middleware/repo/repo_test.go b/router/middleware/repo/repo_test.go index 8e5674833..aa86cd977 100644 --- a/router/middleware/repo/repo_test.go +++ b/router/middleware/repo/repo_test.go @@ -71,7 +71,7 @@ func TestRepo_Establish(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), want) + _ = db.DeleteRepo(context.TODO(), want) db.Close() }() diff --git a/router/middleware/service/service_test.go b/router/middleware/service/service_test.go index 0cc42813f..fba880671 100644 --- a/router/middleware/service/service_test.go +++ b/router/middleware/service/service_test.go @@ -77,9 +77,9 @@ func TestService_Establish(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) - db.DeleteService(context.TODO(), want) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) + _ = db.DeleteService(context.TODO(), want) db.Close() }() @@ -166,7 +166,7 @@ func TestService_Establish_NoBuild(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -219,8 +219,8 @@ func TestService_Establish_NoServiceParameter(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -275,8 +275,8 @@ func TestService_Establish_InvalidServiceParameter(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -331,8 +331,8 @@ func TestService_Establish_NoService(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() diff --git a/router/middleware/step/step_test.go b/router/middleware/step/step_test.go index b44571149..dd9dbafb5 100644 --- a/router/middleware/step/step_test.go +++ b/router/middleware/step/step_test.go @@ -79,9 +79,9 @@ func TestStep_Establish(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) - db.DeleteStep(want) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) + _ = db.DeleteStep(want) db.Close() }() @@ -168,7 +168,7 @@ func TestStep_Establish_NoBuild(t *testing.T) { } defer func() { - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -221,8 +221,8 @@ func TestStep_Establish_NoStepParameter(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -277,8 +277,8 @@ func TestStep_Establish_InvalidStepParameter(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() @@ -333,8 +333,8 @@ func TestStep_Establish_NoStep(t *testing.T) { } defer func() { - db.DeleteBuild(context.TODO(), b) - db.DeleteRepo(context.TODO(), r) + _ = db.DeleteBuild(context.TODO(), b) + _ = db.DeleteRepo(context.TODO(), r) db.Close() }() diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go index b089d50ab..d84a18847 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -91,7 +91,7 @@ func TestUser_Establish(t *testing.T) { } defer func() { - db.DeleteUser(_context.TODO(), want) + _ = db.DeleteUser(_context.TODO(), want) db.Close() }() diff --git a/router/middleware/worker/worker_test.go b/router/middleware/worker/worker_test.go index 4de2db921..2d3578cd0 100644 --- a/router/middleware/worker/worker_test.go +++ b/router/middleware/worker/worker_test.go @@ -57,7 +57,7 @@ func TestWorker_Establish(t *testing.T) { } defer func() { - db.DeleteWorker(context.TODO(), want) + _ = db.DeleteWorker(context.TODO(), want) db.Close() }() diff --git a/secret/native/count_test.go b/secret/native/count_test.go index 389599c81..33ab448be 100644 --- a/secret/native/count_test.go +++ b/secret/native/count_test.go @@ -33,7 +33,7 @@ func TestNative_Count(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), sec) + _ = db.DeleteSecret(context.TODO(), sec) db.Close() }() diff --git a/secret/native/create_test.go b/secret/native/create_test.go index a90f9ac9f..dd1b6b0ff 100644 --- a/secret/native/create_test.go +++ b/secret/native/create_test.go @@ -36,7 +36,7 @@ func TestNative_Create_Org(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), want) + _ = db.DeleteSecret(context.TODO(), want) db.Close() }() @@ -83,7 +83,7 @@ func TestNative_Create_Repo(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), want) + _ = db.DeleteSecret(context.TODO(), want) db.Close() }() @@ -130,7 +130,7 @@ func TestNative_Create_Shared(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), want) + _ = db.DeleteSecret(context.TODO(), want) db.Close() }() @@ -177,7 +177,7 @@ func TestNative_Create_Invalid(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), sec) + _ = db.DeleteSecret(context.TODO(), sec) db.Close() }() diff --git a/secret/native/delete_test.go b/secret/native/delete_test.go index 2d6f683e8..96838d575 100644 --- a/secret/native/delete_test.go +++ b/secret/native/delete_test.go @@ -33,7 +33,7 @@ func TestNative_Delete(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), sec) + _ = db.DeleteSecret(context.TODO(), sec) db.Close() }() diff --git a/secret/native/get_test.go b/secret/native/get_test.go index cbb348456..8272c9e99 100644 --- a/secret/native/get_test.go +++ b/secret/native/get_test.go @@ -37,7 +37,7 @@ func TestNative_Get(t *testing.T) { defer db.Close() defer func() { - db.DeleteSecret(context.TODO(), want) + _ = db.DeleteSecret(context.TODO(), want) db.Close() }() diff --git a/secret/native/list_test.go b/secret/native/list_test.go index 2bf8de37f..f7bba5b81 100644 --- a/secret/native/list_test.go +++ b/secret/native/list_test.go @@ -54,8 +54,8 @@ func TestNative_List(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), sOne) - db.DeleteSecret(context.TODO(), sTwo) + _ = db.DeleteSecret(context.TODO(), sOne) + _ = db.DeleteSecret(context.TODO(), sTwo) db.Close() }() diff --git a/secret/native/update_test.go b/secret/native/update_test.go index ef798ac66..3b4e13172 100644 --- a/secret/native/update_test.go +++ b/secret/native/update_test.go @@ -53,7 +53,7 @@ func TestNative_Update(t *testing.T) { } defer func() { - db.DeleteSecret(context.TODO(), original) + _ = db.DeleteSecret(context.TODO(), original) db.Close() }()