From aa6f2ce9fab263f49d5a4a786ef6ee9d5cdcef31 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Sun, 14 Jan 2024 20:12:55 -0700 Subject: [PATCH] fix(lint): golangci-lint errors --- pkg/nuke/nuke_run_test.go | 10 ++++++---- pkg/nuke/nuke_test.go | 13 ++++++------- pkg/nuke/scan_test.go | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pkg/nuke/nuke_run_test.go b/pkg/nuke/nuke_run_test.go index 0322a17..7affee9 100644 --- a/pkg/nuke/nuke_run_test.go +++ b/pkg/nuke/nuke_run_test.go @@ -2,12 +2,14 @@ package nuke import ( "fmt" - "github.com/ekristen/libnuke/pkg/queue" - "github.com/ekristen/libnuke/pkg/resource" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + + "github.com/ekristen/libnuke/pkg/queue" + "github.com/ekristen/libnuke/pkg/resource" ) type TestResourceSuccess struct{} diff --git a/pkg/nuke/nuke_test.go b/pkg/nuke/nuke_test.go index bac72fe..f4e79a7 100644 --- a/pkg/nuke/nuke_test.go +++ b/pkg/nuke/nuke_test.go @@ -2,7 +2,6 @@ package nuke import ( "fmt" - liberrors "github.com/ekristen/libnuke/pkg/errors" "io" "os" "strings" @@ -13,6 +12,7 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + liberrors "github.com/ekristen/libnuke/pkg/errors" "github.com/ekristen/libnuke/pkg/queue" "github.com/ekristen/libnuke/pkg/resource" ) @@ -339,17 +339,16 @@ var TestResource4Resources []resource.Resource type TestResource4 struct { id string - parentId string - attempts int + parentID string } func (r *TestResource4) Remove() error { - if r.parentId != "" { + if r.parentID != "" { parentFound := false for _, o := range TestResource4Resources { id := o.(resource.LegacyStringer).String() - if id == r.parentId { + if id == r.parentID { parentFound = true } } @@ -378,12 +377,12 @@ func (l *TestResource4Lister) List(o interface{}) ([]resource.Resource, error) { if x == 0 { TestResource4Resources = append(TestResource4Resources, &TestResource4{ id: fmt.Sprintf("resource-%d", x), - parentId: "", + parentID: "", }) } else { TestResource4Resources = append(TestResource4Resources, &TestResource4{ id: fmt.Sprintf("resource-%d", x), - parentId: "resource-0", + parentID: "resource-0", }) } } diff --git a/pkg/nuke/scan_test.go b/pkg/nuke/scan_test.go index e0c0d55..1254c8e 100644 --- a/pkg/nuke/scan_test.go +++ b/pkg/nuke/scan_test.go @@ -180,7 +180,8 @@ func Test_NewScannerWithMorphOpts(t *testing.T) { } scanner := NewScanner("owner", []string{testResourceType}, opts) - scanner.RegisterMutateOptsFunc(morphOpts) + mutateErr := scanner.RegisterMutateOptsFunc(morphOpts) + assert.NoError(t, mutateErr) err := scanner.Run() assert.NoError(t, err)