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
|
//convert reflect.Value to []any
|
||||||
retStructs := make([]any, 0)
|
fl := filled.Len()
|
||||||
for x := 0; x < filled.Len(); x++ {
|
retStructs := make([]any, fl)
|
||||||
retStructs = append(retStructs, filled.Index(x).Interface())
|
for x := 0; x < fl; x++ {
|
||||||
|
retStructs[x] = filled.Index(x).Interface()
|
||||||
}
|
}
|
||||||
|
|
||||||
return &StructMock{
|
return &StructMock{
|
||||||
|
Reference in New Issue
Block a user