🚨 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
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:
parent
ca0c2799ab
commit
7dfcee403e
3 changed files with 5 additions and 3 deletions
|
@ -12,6 +12,8 @@ linters:
|
||||||
- structcheck
|
- structcheck
|
||||||
- exhaustivestruct
|
- exhaustivestruct
|
||||||
- nosnakecase
|
- nosnakecase
|
||||||
|
- gomnd
|
||||||
|
- execinquery
|
||||||
# Too extremist/unusable
|
# Too extremist/unusable
|
||||||
- depguard
|
- depguard
|
||||||
- varnamelen
|
- varnamelen
|
||||||
|
|
|
@ -99,7 +99,7 @@ func VerifyPassword(password string, hash string) (bool, error) {
|
||||||
// parseHash parse existing encoded argon2id string.
|
// parseHash parse existing encoded argon2id string.
|
||||||
func parseHash(source string) (argon2idHash, config, error) {
|
func parseHash(source string) (argon2idHash, config, error) {
|
||||||
separateItem := strings.Split(source, "$")
|
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"}
|
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], ",")
|
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"}
|
return argon2idHash{}, config{}, &parseError{message: "Hash config is not valid"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ func parseIntBeforeSeparator(source *string, sep string) (int, error) { // retur
|
||||||
return 0, &parseIntBeforeSeparatorError{message: *source + ": format only take positive value"}
|
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"}
|
return 0, &parseIntBeforeSeparatorError{message: *source + ": Format only take two number"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue