I think there's some issue with seeding. By default, it seeds some constant. I tried it on 10, 100, 1000, and 1000. It gives the same number i.e 0, 1, 81, 81 and 8081 respectively no matter how many times you repeatedly run it. Docs of golang also suggest that to avoid this behavior you should seed the rand with some value which constantly changes like time.Now().UnixNano().
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think there's some issue with seeding. By default, it seeds some constant. I tried it on 10, 100, 1000, and 1000. It gives the same number i.e 0, 1, 81, 81 and 8081 respectively no matter how many times you repeatedly run it. Docs of golang also suggest that to avoid this behavior you should seed the rand with some value which constantly changes like
time.Now().UnixNano()
.