Skip to content

Commit

Permalink
Remove nil check (#493)
Browse files Browse the repository at this point in the history
As the length of a nil slice is defined as 0, the nil check is
redundand. (suggested by golanci-lint/gosimple)
  • Loading branch information
seb-ehm authored and robertojrojas committed Nov 6, 2019
1 parent 09fb3c4 commit 56fa231
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions check/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ func executeJSONPath(path string, jsonInterface interface{}) (string, error) {
}

func allElementsValid(s, t []string) bool {
sourceEmpty := s == nil || len(s) == 0
targetEmpty := t == nil || len(t) == 0
sourceEmpty := len(s) == 0
targetEmpty := len(t) == 0

if sourceEmpty && targetEmpty {
return true
Expand Down

0 comments on commit 56fa231

Please sign in to comment.