Lint: Fix violations of S1009: should omit nil check; len() for nil slices is defined as zero (#14973)

* Fix violations of S1009: should omit nil check; len() for nil slices is defined as zero

* Changelog fragment
This commit is contained in:
Preston Van Loon
2025-02-21 13:39:33 -06:00
committed by GitHub
parent 8345c271cc
commit 832ebb3f39
6 changed files with 8 additions and 5 deletions

View File

@@ -354,7 +354,7 @@ func IsInSlots(a primitives.Slot, b []primitives.Slot) bool {
// Unique returns an array with duplicates filtered based on the type given
func Unique[T comparable](a []T) []T {
if a == nil || len(a) <= 1 {
if len(a) <= 1 {
return a
}
found := map[T]bool{}