How to generate a fixed length random number in Go?
问题 What is the fastest and simplest way to generate fixed length random numbers in Go? Say to generate 8-digits long numbers, the problem with rand.Intn(100000000) is that the result might be far less than 8-digits, and padding it with leading zeros doesn't look like a good answer to me. I.e., I care about the the quality of the randomness more in the sense of its length. So I'm thinking, for this specific problem, would the following be the fastest and simplest way to do it? 99999999 - rand