Open smyrman opened 8 years ago
My particular use case for adding it would be to allow reproduce benchmarks or test results by setting the seed. Allowing to set the rand.Source opens up for more use cases than just allowing to set the seed, so better to expose SetSource than to expose a SetSeed function;-)
From the discussion on #1, I presume it probably make sense to wrap the provided src in a lockedSource insatance to make it thread safe.
Thats make sense. I will be making a huge refactoring in a few weeks, there will be a constructor to create a custom faker instance with rand.Source
from arguments.
fyi this issue seems related to the merged PR #15 which allows you to seed the RNG.
I guess all that would be needed, would be to expose a method: