Code review comment for lp:~rvb/gwacl/random-pw

Raphaël Badin (rvb) wrote :

> Looks good.

Thanks for the review!

> [1]
>
> +const (
> +    // Valid passwords must be 6-72 characters long.
> +    passwordSize = 50
> +)
>
> According to http://www.universetoday.com/36302/atoms-in-the-universe/
> this means that there are more possible password combinations than
> there are atoms in the universe.

The more the merrier!
>
>
> [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.

Fixed.

> [3]
>
> +    id := letter + upperCaseLetter + digit
> +    for len(id) < passwordSize {
> +        id += pickOne(chars)
> +    }
> +    return id
>
> s/id/password/ ?

Okay, done.

« Back to merge proposal