2018-06-30 22:07:12 +03:00

12 lines
203 B
Go

// args: -Eprealloc
package testdata
func Prealloc(source []int) []int {
var dest []int // ERROR "Consider preallocating `dest`"
for _, v := range source {
dest = append(dest, v)
}
return dest
}