honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/simple/s1009/testdata/src/example.com/CheckRedundantNilCheckWithLen/nil-len_generics.go (about) 1 //go:build go1.18 2 3 package pkg 4 5 func fn1[T []int | *[4]int](a T) { 6 if a != nil && len(a) > 0 { // don't flag, because of the pointer 7 } 8 } 9 10 func fn2[T []int | []string | map[string]int](a T) { 11 if a != nil && len(a) > 0 { //@ diag(`should omit nil check`) 12 } 13 }