Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-david-voisin committed Aug 26, 2024
1 parent f9b9e03 commit 667a13a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gopassword.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func Generate(n ...int) string {
randString := base64.StdEncoding.EncodeToString(randBytes)

password := randString[:length]
password = strings.Replace(password, "+", defaultSpecialChar, -1)
password = strings.Replace(password, "/", defaultSpecialChar, -1)
password = strings.ReplaceAll(password, "+", defaultSpecialChar)
password = strings.ReplaceAll(password, "/", defaultSpecialChar)

return password
}
2 changes: 1 addition & 1 deletion gopassword_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestGenerate(t *testing.T) {
})

t.Run("It must contain only alphanumeric or underscore characters", func(t *testing.T) {
allowedCharacters, _ := regexp.Compile("^[a-zA-Z0-9_]+$")
allowedCharacters := regexp.MustCompile("^[a-zA-Z0-9_]+$")

// Try various times to ensure the result is not casual
for _ = range 1000 {
Expand Down

0 comments on commit 667a13a

Please sign in to comment.