From 428381545db53cb4a0a95d600d14ea4f20f54761 Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 26 Sep 2025 16:18:27 -0400 Subject: [PATCH] adding proper allocations --- lazy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lazy.go b/lazy.go index aa2e780..63230fc 100644 --- a/lazy.go +++ b/lazy.go @@ -28,10 +28,10 @@ func GenerateRandomResults(query string, exampleObj any, keyVal any, rowCount in retType := reflect.TypeOf(exampleObj) maxFieldCount := retType.NumField() columns := make([]string, 0, maxFieldCount) - rows := make([][]driver.Value, 0, maxFieldCount) + rows := make([][]driver.Value, 0) - //double loop here to allow for multiple rows for y := 0; y < rowCount; y++ { + rows[y] = make([]driver.Value, 0) for x := 0; x < maxFieldCount; x++ { field := retType.Field(x) dbTag := field.Tag.Get("db")