Skip to content

Commit abe9bd2

Browse files
ashanbrownSeigeC
authored andcommitted
Bump makezero to v1.1.0 (golangci#2490)
1 parent 5742d95 commit abe9bd2

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/OpenPeeDeeP/depguard v1.1.0
1212
github.com/alexkohler/prealloc v1.0.0
1313
github.com/ashanbrown/forbidigo v1.3.0
14-
github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde
14+
github.com/ashanbrown/makezero v1.1.0
1515
github.com/bkielbasa/cyclop v1.2.0
1616
github.com/blizzy78/varnamelen v0.5.0
1717
github.com/bombsimon/wsl/v3 v3.3.0

go.sum

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/testdata/makezero.go

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ func Makezero() []int {
88
return append(x, 1) // ERROR "append to slice `x` with non-zero initialized length"
99
}
1010

11+
func MakezeroMultiple() []int {
12+
x, y := make([]int, math.MaxInt8), make([]int, math.MaxInt8)
13+
return append(x, // ERROR "append to slice `x` with non-zero initialized length"
14+
append(y, 1)...) // ERROR "append to slice `y` with non-zero initialized length"
15+
}
16+
1117
func MakezeroNolint() []int {
1218
x := make([]int, math.MaxInt8)
1319
return append(x, 1) //nolint:makezero // ok that we're appending to an uninitialized slice

0 commit comments

Comments
 (0)