Here is a simple example of generating a random password with only lowercase letters:
main.go463 chars25 lines
This will generate a random password with 10 characters using only lowercase letters. The password is created by randomly selecting characters from the letterBytes
constant string. We use the math/rand
package to generate random numbers and we seed the random number generator with the current time. Finally, we print the generated password to the console.
gistlibby LogSnag