+ // Only digits and lower-case ASCII letters are accepted.
+ const (
+ chars = letters + digits + upperCaseLetters
+ )
+
The comment is incorrect. Also, you could dispense with the braces and
the blank line to try and claw back some of the losses incurred from
Go's syntax.
[3]
+ id := letter + upperCaseLetter + digit
+ for len(id) < passwordSize {
+ id += pickOne(chars)
+ }
+ return id
Looks good.
[1]
+const (
+ // Valid passwords must be 6-72 characters long.
+ passwordSize = 50
+)
According to http:// www.universetod ay.com/ 36302/atoms- in-the- universe/
this means that there are more possible password combinations than
there are atoms in the universe.
[2]
+ // Only digits and lower-case ASCII letters are accepted.
+ const (
+ chars = letters + digits + upperCaseLetters
+ )
+
The comment is incorrect. Also, you could dispense with the braces and
the blank line to try and claw back some of the losses incurred from
Go's syntax.
[3]
+ id := letter + upperCaseLetter + digit
+ for len(id) < passwordSize {
+ id += pickOne(chars)
+ }
+ return id
s/id/password/ ?