生成N位随机数,方法如下
// 随机数字串func RandomNum(length int) string {result := \"\"rand.Seed(time.Now().UnixNano())for i := 0; i < length; i++ {num := rand.Intn(10)result = result + strconv.Itoa(num)}return result}
生成N位随机数,方法如下
// 随机数字串func RandomNum(length int) string {result := \"\"rand.Seed(time.Now().UnixNano())for i := 0; i < length; i++ {num := rand.Intn(10)result = result + strconv.Itoa(num)}return result}