From 7ab9424459afdd6d2c9def84ed32ac6495b115f1 Mon Sep 17 00:00:00 2001 From: Luca Burgazzoli Date: Thu, 16 May 2024 15:40:51 +0200 Subject: [PATCH] chore(lint): enable nlreturn --- .golangci.yml | 3 ++- pkg/controller/gc/gc.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 17a0ebb..d59dcd3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -38,6 +38,8 @@ linters-settings: wsl: allow-cuddle-declarations: true allow-separated-leading-comment: true + nlreturn: + block-size: 2 linters: enable-all: true disable: @@ -71,7 +73,6 @@ linters: - maligned - nakedret - nilnil - - nlreturn - nosnakecase - paralleltest - testpackage diff --git a/pkg/controller/gc/gc.go b/pkg/controller/gc/gc.go index f7a8275..b002268 100644 --- a/pkg/controller/gc/gc.go +++ b/pkg/controller/gc/gc.go @@ -67,6 +67,7 @@ func (gc *GC) deleteEachOf(ctx context.Context, c *client.Client, selector label if err := c.List(ctx, &items, options...); err != nil { if k8serrors.IsForbidden(err) { gc.l.Info("cannot gc, forbidden", "gvk", GVK.String()) + continue }