github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/test/testdata/prealloc.go (about)

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