Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix lint issues
Update golangci-lint to 1.57
Apply lint fixes
  • Loading branch information
Neo2308 committed Apr 26, 2024
commit 808c615c88cad0a7238fca28b71d4156d9f8476d
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
go-version-file: "go.mod"
- uses: golangci/golangci-lint-action@v4
with:
version: v1.51
version: v1.57
args: --timeout 5m

go-apidiff:
Expand Down
2 changes: 1 addition & 1 deletion predicate/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func ExampleNewPause() {
os.Exit(1)
}

var r reconcile.Func = func(ctx context.Context, req reconcile.Request) (reconcile.Result, error) {
var r reconcile.Func = func(_ context.Context, _ reconcile.Request) (reconcile.Result, error) {
// Your reconcile logic would go here. No paused Pod events would trigger reconciliation.
return reconcile.Result{}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions prune/prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ var _ = Describe("Prune", func() {
Expect(pruner).ShouldNot(BeNil())

// IsPrunableFunc that throws non Unprunable error
errorPrunableFunc := func(obj client.Object) error {
errorPrunableFunc := func(_ client.Object) error {
return fmt.Errorf("TEST")
}

Expand All @@ -309,7 +309,7 @@ var _ = Describe("Prune", func() {
Expect(jobs.Items).Should(HaveLen(3))

// strategy that will return an error
prunerStrategy := func(ctx context.Context, objs []client.Object) ([]client.Object, error) {
prunerStrategy := func(_ context.Context, _ []client.Object) ([]client.Object, error) {
return nil, fmt.Errorf("TESTERROR")
}

Expand Down
4 changes: 2 additions & 2 deletions prune/strategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// resources to prune based on a maximum count of resources allowed.
// If the max count of resources is exceeded, the oldest resources are prioritized for pruning
func NewPruneByCountStrategy(count int) StrategyFunc {
return func(ctx context.Context, objs []client.Object) ([]client.Object, error) {
return func(_ context.Context, objs []client.Object) ([]client.Object, error) {
if len(objs) <= count {
return nil, nil
}
Expand All @@ -47,7 +47,7 @@ func NewPruneByCountStrategy(count int) StrategyFunc {
// NewPruneByDateStrategy returns a StrategyFunc that will return a list of
// resources to prune where the resource CreationTimestamp is after the given time.Time.
func NewPruneByDateStrategy(date time.Time) StrategyFunc {
return func(ctx context.Context, objs []client.Object) ([]client.Object, error) {
return func(_ context.Context, objs []client.Object) ([]client.Object, error) {
var objsToPrune []client.Object

for _, obj := range objs {
Expand Down