🚨 Fix linter error
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful

This commit is contained in:
Ada 2024-05-11 00:42:58 +02:00
parent ca0c2799ab
commit 7dfcee403e
Signed by: ada
GPG key ID: 6A7F898157C6DE6E
3 changed files with 5 additions and 3 deletions

View file

@ -12,6 +12,8 @@ linters:
- structcheck
- exhaustivestruct
- nosnakecase
- gomnd
- execinquery
# Too extremist/unusable
- depguard
- varnamelen

View file

@ -99,7 +99,7 @@ func VerifyPassword(password string, hash string) (bool, error) {
// parseHash parse existing encoded argon2id string.
func parseHash(source string) (argon2idHash, config, error) {
separateItem := strings.Split(source, "$")
if len(separateItem) != 6 { //nolint:gomnd
if len(separateItem) != 6 { //nolint:mnd
return argon2idHash{}, config{}, &parseError{message: "Hash format is not valid"}
}
@ -108,7 +108,7 @@ func parseHash(source string) (argon2idHash, config, error) {
}
separateParam := strings.Split(separateItem[3], ",")
if len(separateParam) != 3 { //nolint:gomnd
if len(separateParam) != 3 { //nolint:mnd
return argon2idHash{}, config{}, &parseError{message: "Hash config is not valid"}
}

View file

@ -45,7 +45,7 @@ func parseIntBeforeSeparator(source *string, sep string) (int, error) { // retur
return 0, &parseIntBeforeSeparatorError{message: *source + ": format only take positive value"}
}
if value > 99 { //nolint:gomnd
if value > 99 { //nolint:mnd
return 0, &parseIntBeforeSeparatorError{message: *source + ": Format only take two number"}
}