adding proper allocations
This commit is contained in:
4
lazy.go
4
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")
|
||||
|
Reference in New Issue
Block a user