Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump makezero to 1.1.0 #2490

Merged
merged 1 commit into from
Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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