golangci-lint/test/testdata/makezero_always.go
Ludovic Fernandez 1b30a171ce
fix: wrong load mode (#1733)
* fix: asciicheck

* fix: exportloopref

* fix: exhaustivestruct

* fix: makezero
2021-02-14 12:11:38 -06:00

16 lines
367 B
Go

//args: -Emakezero
//config: linters-settings.makezero.always=true
package testdata
import "math"
func MakezeroAlways() []int {
x := make([]int, math.MaxInt8) // ERROR "slice `x` does not have non-zero initial length"
return x
}
func MakezeroAlwaysNolint() []int {
x := make([]int, math.MaxInt8) //nolint:makezero // ok that this is not initialized
return x
}