makezero could make mistake in judge slice append when the slice declare in same line with other non-zero slice:
// will also report "append to slice `b` with non-zero initialized length at testing.go:7:9" while it shouldn't
package bar
func foo() {
a, b := make([]int, 10), make([]int, 0)
a = append(a, 10)
b = append(b, 10)
}
makezero failed to report in judge slice append when the slice declare in same line with other zero slice in front:
// will report nothing while it should
package bar
func foo() {
a, b := make([]int, 0), make([]int, 10)
a = append(a, 10)
b = append(b, 10)
}
func foo() { a, b := make([]int, 0), make([]int, 10) a = append(a, 10) b = append(b, 10) }