Skip to content

Commit

Permalink
observer_test: Pre-allocate slice
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Jun 7, 2021
1 parent 130ef27 commit 4223fa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zaptest/observer/observer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestFilters(t *testing.T) {
}),
want: func() []LoggedEntry {
// Do not modify logs slice.
w := []LoggedEntry{}
w := make([]LoggedEntry, 0, len(logs))
w = append(w, logs[0:5]...)
w = append(w, logs[7])
return w
Expand Down

0 comments on commit 4223fa6

Please sign in to comment.