gopkg.in/golangci/golangci-lint.v1@v1.10.1/test/testdata/prealloc.go (about)

     1  // args: -Eprealloc
     2  package testdata
     3  
     4  func Prealloc(source []int) []int {
     5  	var dest []int // ERROR "Consider preallocating `dest`"
     6  	for _, v := range source {
     7  		dest = append(dest, v)
     8  	}
     9  
    10  	return dest
    11  }