Skip to content

Commit

Permalink
fix(lint): golangci-lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Jan 15, 2024
1 parent 0ebf61d commit aa6f2ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
10 changes: 6 additions & 4 deletions pkg/nuke/nuke_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
13 changes: 6 additions & 7 deletions pkg/nuke/nuke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package nuke

import (
"fmt"
liberrors "github.com/ekristen/libnuke/pkg/errors"
"io"
"os"
"strings"
Expand All @@ -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"
)
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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",
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/nuke/scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa6f2ce

Please sign in to comment.