From 18f44b118faaba6274430c06de5c32f9a2719f17 Mon Sep 17 00:00:00 2001 From: Ada Date: Sat, 11 May 2024 00:42:58 +0200 Subject: [PATCH] :rotating_light: Fix linter error --- .golangci.yaml | 2 ++ go.sum | 4 ---- internal/secret/crypto.go | 4 ++-- internal/utils/utils.go | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index e3bdba6..152a438 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -12,6 +12,8 @@ linters: - structcheck - exhaustivestruct - nosnakecase + - gomnd + - execinquery # Too extremist/unusable - depguard - varnamelen diff --git a/go.sum b/go.sum index 74d21b9..8baacf2 100644 --- a/go.sum +++ b/go.sum @@ -10,11 +10,7 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/internal/secret/crypto.go b/internal/secret/crypto.go index 05276d9..e711b26 100644 --- a/internal/secret/crypto.go +++ b/internal/secret/crypto.go @@ -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"} } diff --git a/internal/utils/utils.go b/internal/utils/utils.go index ecba2b5..f3f9ca5 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -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"} }