ironarachne / namegen

A library and CLI program for generating random names, written in Go.
Apache License 2.0
33 stars 29 forks source link

Fix names duplication at NameGeneratorFromType #71

Closed hadihammurabi closed 3 years ago

hadihammurabi commented 3 years ago

To ensure that the names in list are truly individual, it is necessary to make each name unique. It also improves accuracy when generating random data.

To prevent performance degradation, the duplication check is run once, when data has been collected but before randomization. So it takes less resources on this process.

BenOvermyer commented 3 years ago

This shouldn't be necessary if there are no duplicates in the data.

If there are duplicates in the data right now, removing them will solve this problem better than adding a function to do it during runtime.