1package pkg 2 3import "fmt" 4 5func fn1() { 6 var s []int 7 s = append(s, 1) // want `this result of append is never used` 8 s = append(s, 1) // want `this result of append is never used` 9} 10 11func fn2() (named []int) { 12 named = append(named, 1) 13 return 14} 15 16func fn3() { 17 s := make([]int, 0) 18 s = append(s, 1) // want `this result of append is never used` 19} 20 21func fn4() []int { 22 var s []int 23 s = append(s, 1) 24 return s 25} 26 27func fn5() { 28 var s []int 29 s = append(s, 1) 30 fn6(s) 31} 32 33func fn6([]int) {} 34 35func fn7() { 36 var s []int 37 fn8(&s) 38 s = append(s, 1) 39} 40 41func fn8(*[]int) {} 42 43func fn9() { 44 var s []int 45 s = append(s, 1) 46 fmt.Println(s) 47 s = append(s, 1) // want `this result of append is never used` 48} 49 50func fn10() { 51 var s []int 52 return 53 s = append(s, 1) 54} 55 56func fn11() { 57 var s []int 58 for x := 0; x < 10; x++ { 59 s = append(s, 1) // want `this result of append is never used` 60 } 61} 62