From 18df53806e97f5ed41161edeb7607bf0f04b1d07 Mon Sep 17 00:00:00 2001 From: Mateus Oliveira Date: Thu, 2 Jan 2025 03:14:53 -0300 Subject: [PATCH] :seedling: Enable govet settings and fix issue found (#4465) Fix linter error `nilness: impossible condition: nil != nil (govet)` ``` golangci-lint run pkg/plugins/golang/v4/scaffolds/edit.go:60:9: nilness: impossible condition: nil != nil (govet) if err != nil && s.multigroup != s.config.IsMultiGroup() { ^ make: *** [lint] Error 1 ``` Signed-off-by: Mateus Oliveira --- .golangci.yml | 5 +++++ pkg/plugins/golang/v4/scaffolds/edit.go | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 4109c5b06a2..1cb1356241a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,6 +17,11 @@ issues: - gosec linters-settings: + govet: + enable-all: true + disable: + - fieldalignment + - shadow revive: rules: # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration diff --git a/pkg/plugins/golang/v4/scaffolds/edit.go b/pkg/plugins/golang/v4/scaffolds/edit.go index 17d015393d8..9752065a96d 100644 --- a/pkg/plugins/golang/v4/scaffolds/edit.go +++ b/pkg/plugins/golang/v4/scaffolds/edit.go @@ -56,11 +56,6 @@ func (s *editScaffolder) Scaffold() error { } str := string(bs) - // Ignore the error encountered, if the file is already in desired format. - if err != nil && s.multigroup != s.config.IsMultiGroup() { - return err - } - if s.multigroup { _ = s.config.SetMultiGroup() } else {