Maybe my library will work for you (or help)? This is a generator which init with O(1) time complexity and O(N) time complexity. Intn() method (get new random number) take O(1) time complexity since no duplicate/conflict will occur.
If all numbers used up, a panic will be throw, and no number will be wasted. The library use lock to implement concurrency safety, may think about non-lock method in the future.
Here is the link:
https://github.com/yihaoye/lurand