You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix behavior when a nil slice is returned as in the case below.
type myIntSlice []int
func (r myIntSlice) Count() int {
count := 0
for _, e := range r {
count = count + e
}
return count
}
func foo(input myIntSlice) myIntSlice {
var result myIntSlice
for _, t := range input {
result = append(result, t)
}
return result
}
func test() {
_ = foo(nil).Count()
}
The text was updated successfully, but these errors were encountered:
sonalmahajan15
changed the title
False positive when an nil slice is returned from a function
False positive when a nil slice is returned from a function
Feb 4, 2025
Fix behavior when a nil slice is returned as in the case below.
The text was updated successfully, but these errors were encountered: