Skip to content

Commit 1b7cee8

Browse files
a-hilalyk8s-ci-robot
authored andcommitted
fix: preallocate asts slice in maps_test.go to satisfy prealloc linter
1 parent 3eeb3f0 commit 1b7cee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cel/library/maps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestMaps(t *testing.T) {
3737
env := testMapsEnv(t)
3838
for i, tc := range mapsTests {
3939
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
40-
var asts []*cel.Ast
40+
asts := make([]*cel.Ast, 0, 2)
4141
pAst, iss := env.Parse(tc.expr)
4242
if iss.Err() != nil {
4343
t.Fatalf("env.Parse(%v) failed: %v", tc.expr, iss.Err())

0 commit comments

Comments
 (0)