github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/simple/testdata/src/LintMakeLenCap/LintMakeLenCap.go (about)

     1  package pkg
     2  
     3  func fn() {
     4  	const c = 0
     5  	var x, y int
     6  	type s []int
     7  	type ch chan int
     8  	_ = make([]int, 1)
     9  	_ = make([]int, 0)       // length is mandatory for slices, don't suggest removal
    10  	_ = make(s, 0)           // length is mandatory for slices, don't suggest removal
    11  	_ = make(chan int, c)    // constant of 0 may be due to debugging, math or platform-specific code
    12  	_ = make(chan int, 0)    // MATCH "should use make(chan int) instead"
    13  	_ = make(ch, 0)          // MATCH "should use make(ch) instead"
    14  	_ = make(map[int]int, 0) // MATCH "should use make(map[int]int) instead"
    15  	_ = make([]int, 1, 1)    // MATCH "should use make([]int, 1) instead"
    16  	_ = make([]int, x, x)    // MATCH "should use make([]int, x) instead"
    17  	_ = make([]int, 1, 2)
    18  	_ = make([]int, x, y)
    19  }