From 1693c59e0de24d1cdc72da28378798dfb561584b Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sat, 22 Apr 2023 08:13:09 +0000 Subject: [PATCH] chore(lint): fix issues - sources/env: remove unused `envToInt` - fix `ireturn` error for `newCipherDESCBCBlock` --- .golangci.yml | 4 ++++ internal/configuration/sources/env/helpers.go | 8 -------- internal/openvpn/pkcs8/descbc.go | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 04704554..a3bf8465 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -29,6 +29,10 @@ issues: - text: "returns interface \\(github\\.com\\/vishvananda\\/netlink\\.Link\\)" linters: - ireturn + - path: "internal\\/openvpn\\/pkcs8\\/descbc\\.go" + text: "newCipherDESCBCBlock returns interface \\(github\\.com\\/youmark\\/pkcs8\\.Cipher\\)" + linters: + - ireturn linters: enable: diff --git a/internal/configuration/sources/env/helpers.go b/internal/configuration/sources/env/helpers.go index 4c040429..006db996 100644 --- a/internal/configuration/sources/env/helpers.go +++ b/internal/configuration/sources/env/helpers.go @@ -29,14 +29,6 @@ func envToCSV(envKey string) (values []string) { return lowerAndSplit(csv) } -func envToInt(envKey string) (n int, err error) { - s := getCleanedEnv(envKey) - if s == "" { - return 0, nil - } - return strconv.Atoi(s) -} - func envToFloat64(envKey string) (f float64, err error) { s := getCleanedEnv(envKey) if s == "" { diff --git a/internal/openvpn/pkcs8/descbc.go b/internal/openvpn/pkcs8/descbc.go index e5f91444..104f6ad4 100644 --- a/internal/openvpn/pkcs8/descbc.go +++ b/internal/openvpn/pkcs8/descbc.go @@ -14,7 +14,7 @@ func init() { //nolint:gochecknoinits pkcs8lib.RegisterCipher(oidDESCBC, newCipherDESCBCBlock) } -func newCipherDESCBCBlock() pkcs8lib.Cipher { //nolint:ireturn +func newCipherDESCBCBlock() pkcs8lib.Cipher { return cipherDESCBC{} }