proper slice allocation
This commit is contained in:
7
lazy.go
7
lazy.go
@@ -171,9 +171,10 @@ func RandomStruct(c StructConfig) (*StructMock, error) {
|
||||
}
|
||||
|
||||
//convert reflect.Value to []any
|
||||
retStructs := make([]any, 0)
|
||||
for x := 0; x < filled.Len(); x++ {
|
||||
retStructs = append(retStructs, filled.Index(x).Interface())
|
||||
fl := filled.Len()
|
||||
retStructs := make([]any, fl)
|
||||
for x := 0; x < fl; x++ {
|
||||
retStructs[x] = filled.Index(x).Interface()
|
||||
}
|
||||
|
||||
return &StructMock{
|
||||
|
Reference in New Issue
Block a user