package main
import (
"fmt"
"math/rand"
)
func randomString(n int) string {
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
str := make([]rune, n)
for i := range str {
str[i] = letters[rand.Intn(len(letters))]
}
return string(str)
}
func main() {
fmt.Println(randomString(20))
}
Output
BpLnfgDsc2WD8F2qNfHK