diff --git a/lazy.go b/lazy.go index 6c38fe0..525c23f 100644 --- a/lazy.go +++ b/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{