Skip to content

Commit

Permalink
🌱 Enable govet settings and fix issue found (kubernetes-sigs#4465)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mateusoliveira43 authored Jan 2, 2025
1 parent f051464 commit 18df538
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions pkg/plugins/golang/v4/scaffolds/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 18df538

Please sign in to comment.