Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GGP1 committed Feb 4, 2021
1 parent d78d19b commit f6e2dc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion password.go
Expand Up @@ -211,7 +211,7 @@ repeat:
func (p *Password) validateLevels() error {
for _, lvl := range p.Levels {
if len(lvl) < 1 {
continue
return errors.New("empty levels aren't allowed")
}

counter := 0
Expand Down
1 change: 1 addition & 0 deletions password_test.go
Expand Up @@ -107,6 +107,7 @@ func TestInvalidPassword(t *testing.T) {
cases := map[string]*Password{
"invalid length": {Length: 0},
"invalid levels": {Length: 10},
"empty level": {Length: 3, Levels: []Level{Level("")}},
"not enough characters to meet the length required": {
Length: 30,
Levels: []Level{Lowercase},
Expand Down

0 comments on commit f6e2dc5

Please sign in to comment.