golangci-lint/test/testdata/prealloc.go

12 lines
214 B
Go
Raw Permalink Normal View History

//golangcitest:args -Eprealloc
2018-06-30 21:02:41 +03:00
package testdata
func Prealloc(source []int) []int {
var dest []int // want "Consider pre-allocating `dest`"
2018-06-30 21:02:41 +03:00
for _, v := range source {
dest = append(dest, v)
}
return dest
}