From dcbb587a8b330fd030dd69b4a646c237d1f4b9ad Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Wed, 8 Jan 2025 21:10:11 -0500 Subject: [PATCH] golangci-lint: remove if-return from the linters if-return has been removed from the default list of revive for a valid reason. See the argument in https://github.com/mgechev/revive/pull/843. Comparing two snippets 1. ``` if err := v.volSyncHandler.DeleteRS(name, namespace); err != nil { return err } if err := v.volSyncHandler.DeleteRD(name, namespace); err != nil { return err } if err := v.volSyncHandler.DeleteSnapshots(namespace); err != nil { return err } return nil ``` 2. ``` if err := v.volSyncHandler.DeleteRS(name, namespace); err != nil { return err } if err := v.volSyncHandler.DeleteRD(name, namespace); err != nil { return err } return v.volSyncHandler.DeleteSnapshots(namespace) ``` 1 is a lot easier to read compared to 2 but if-return throws an error for it. Signed-off-by: Raghavendra Talur --- .golangci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.golangci.yaml b/.golangci.yaml index 1488b0a82..4ae25207b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -47,7 +47,6 @@ linters-settings: - name: error-strings - name: error-naming - name: exported - - name: if-return - name: increment-decrement - name: var-naming - name: var-declaration