Skip to content

Commit

Permalink
Bump makezero to v1.1.0 (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashanbrown authored Jan 16, 2022
1 parent efb3599 commit 6e2e51d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/OpenPeeDeeP/depguard v1.1.0
github.com/alexkohler/prealloc v1.0.0
github.com/ashanbrown/forbidigo v1.3.0
github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde
github.com/ashanbrown/makezero v1.1.0
github.com/bkielbasa/cyclop v1.2.0
github.com/blizzy78/varnamelen v0.5.0
github.com/bombsimon/wsl/v3 v3.3.0
Expand Down
6 changes: 2 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/testdata/makezero.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ func Makezero() []int {
return append(x, 1) // ERROR "append to slice `x` with non-zero initialized length"
}

func MakezeroMultiple() []int {
x, y := make([]int, math.MaxInt8), make([]int, math.MaxInt8)
return append(x, // ERROR "append to slice `x` with non-zero initialized length"
append(y, 1)...) // ERROR "append to slice `y` with non-zero initialized length"
}

func MakezeroNolint() []int {
x := make([]int, math.MaxInt8)
return append(x, 1) //nolint:makezero // ok that we're appending to an uninitialized slice
Expand Down

0 comments on commit 6e2e51d

Please sign in to comment.