go随机生成token
const ( defaultTokenLen int = 16 ) func GenerateToken() string { rand.Seed(time.Now().UnixNano()) runes := []rune("abcdefghijklmnopqrstuvwxyz0123456789") b := make([]rune, defaultTokenLen) for i := range b { b[i] = runes[rand.Intn(len(runes))] } return string(b) }
通往牛逼的路上,在意的只有远方!