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
When ranging over a list that contains conditional break/continue directives and a slice = append(slice, element) at the end, prealloc suggests preallocation.
I also get a false positive with code that looks like this:
// ...var (
a []stringumap[string]struct{}
)
// some code to populate u// where a is used to return in case of errorsa=make([]string,0, len(u))
fors:=rangeu {
a=append(s)
}
// ...
When ranging over a list that contains conditional
break
/continue
directives and aslice = append(slice, element)
at the end,prealloc
suggests preallocation.No lint triggered
Lint triggered
The text was updated successfully, but these errors were encountered: