Skip to content

Commit 4ddbcd8

Browse files
committed
Bump makezero to 1.1.0
Now includes support for multiple makes per line
1 parent da91922 commit 4ddbcd8

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/OpenPeeDeeP/depguard v1.0.1
1010
github.com/alexkohler/prealloc v1.0.0
1111
github.com/ashanbrown/forbidigo v1.2.0
12-
github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde
12+
github.com/ashanbrown/makezero v1.1.0
1313
github.com/bkielbasa/cyclop v1.2.0
1414
github.com/bombsimon/wsl/v3 v3.3.0
1515
github.com/charithe/durationcheck v0.0.7

go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/testdata/makezero.go

Lines changed: 6 additions & 0 deletions
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)