From db52a8b17ea3403a445eb7ed452219bd3d514fe3 Mon Sep 17 00:00:00 2001 From: Rahmat Hidayat Date: Wed, 9 Aug 2023 11:07:16 +0700 Subject: [PATCH] chore: fix lint warnings --- api/handler/v1beta1/appeal.go | 1 + api/handler/v1beta1/appeal_test.go | 4 ++-- core/appeal/service_test.go | 1 - internal/store/postgres/approval_repository_test.go | 1 - pkg/evaluator/expression_test.go | 3 ++- plugins/notifiers/slack/client_test.go | 1 - plugins/providers/bigquery/model.go | 2 -- plugins/providers/bigquery/model_test.go | 3 ++- utils/utils_test.go | 3 ++- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/api/handler/v1beta1/appeal.go b/api/handler/v1beta1/appeal.go index ea35ec4a2..82a993f33 100644 --- a/api/handler/v1beta1/appeal.go +++ b/api/handler/v1beta1/appeal.go @@ -3,6 +3,7 @@ package v1beta1 import ( "context" "errors" + guardianv1beta1 "github.com/goto/guardian/api/proto/gotocompany/guardian/v1beta1" "github.com/goto/guardian/core/appeal" "github.com/goto/guardian/domain" diff --git a/api/handler/v1beta1/appeal_test.go b/api/handler/v1beta1/appeal_test.go index f3fccb0af..bdc9608f7 100644 --- a/api/handler/v1beta1/appeal_test.go +++ b/api/handler/v1beta1/appeal_test.go @@ -3,9 +3,10 @@ package v1beta1_test import ( "context" "errors" - "github.com/google/uuid" "time" + "github.com/google/uuid" + guardianv1beta1 "github.com/goto/guardian/api/proto/gotocompany/guardian/v1beta1" "github.com/goto/guardian/core/appeal" "github.com/goto/guardian/domain" @@ -702,7 +703,6 @@ func (s *GrpcHandlersSuite) TestGetAppeal() { s.Nil(res) s.appealService.AssertExpectations(s.T()) }) - } func (s *GrpcHandlersSuite) TestCancelAppeal() { diff --git a/core/appeal/service_test.go b/core/appeal/service_test.go index cf2ea3b61..c448d97db 100644 --- a/core/appeal/service_test.go +++ b/core/appeal/service_test.go @@ -2395,7 +2395,6 @@ func (s *ServiceTestSuite) TestCancel() { s.Nil(actualResult) s.EqualError(actualErr, expectedErr.Error()) }) - } func (s *ServiceTestSuite) TestAddApprover() { diff --git a/internal/store/postgres/approval_repository_test.go b/internal/store/postgres/approval_repository_test.go index 045fc6920..458d39937 100644 --- a/internal/store/postgres/approval_repository_test.go +++ b/internal/store/postgres/approval_repository_test.go @@ -118,7 +118,6 @@ func (s *ApprovalRepositoryTestSuite) TearDownSuite() { } func (s *ApprovalRepositoryTestSuite) TestListApprovals() { - pendingAppeal := &domain.Appeal{ ResourceID: s.dummyResource.ID, PolicyID: s.dummyPolicy.ID, diff --git a/pkg/evaluator/expression_test.go b/pkg/evaluator/expression_test.go index a127ab308..c98daf6f8 100644 --- a/pkg/evaluator/expression_test.go +++ b/pkg/evaluator/expression_test.go @@ -1,9 +1,10 @@ package evaluator_test import ( - "github.com/stretchr/testify/assert" "testing" + "github.com/stretchr/testify/assert" + "github.com/goto/guardian/pkg/evaluator" ) diff --git a/plugins/notifiers/slack/client_test.go b/plugins/notifiers/slack/client_test.go index 798d4a2ac..26aa74aec 100644 --- a/plugins/notifiers/slack/client_test.go +++ b/plugins/notifiers/slack/client_test.go @@ -70,7 +70,6 @@ func (s *ClientTestSuite) TestNotify() { s.Equal(expectedErrs, actualErrs) }) - } func (s *ClientTestSuite) TestParseMessage() { diff --git a/plugins/providers/bigquery/model.go b/plugins/providers/bigquery/model.go index 23036253c..9245db1c3 100644 --- a/plugins/providers/bigquery/model.go +++ b/plugins/providers/bigquery/model.go @@ -16,8 +16,6 @@ const ( ResourceTypeDataset = "dataset" // ResourceTypeTable is the resource type name for BigQuery table ResourceTypeTable = "table" - - resourceTypeUnknown = "unknown" ) // Dataset is a reference to a BigQuery dataset diff --git a/plugins/providers/bigquery/model_test.go b/plugins/providers/bigquery/model_test.go index ade630567..5e936e9ce 100644 --- a/plugins/providers/bigquery/model_test.go +++ b/plugins/providers/bigquery/model_test.go @@ -1,9 +1,10 @@ package bigquery_test import ( - "github.com/goto/guardian/core/resource" "testing" + "github.com/goto/guardian/core/resource" + "github.com/goto/guardian/domain" "github.com/goto/guardian/plugins/providers/bigquery" "github.com/stretchr/testify/assert" diff --git a/utils/utils_test.go b/utils/utils_test.go index 1a122a13f..89fffb58d 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -1,8 +1,9 @@ package utils import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestMapToSlice(t *testing.T) {