From 2a0ed1ebbf2dbb5ba4bbec8abc3edad86ba770f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=E1=B4=8F=E1=B4=8F=C9=B4D4=CA=80=E1=B4=8B?= Date: Sun, 14 Aug 2022 22:51:31 +0800 Subject: [PATCH] chore: add lint ruler, exclude unused variable --- .golangci.yml | 6 ++++++ internal/browser/browser.go | 1 - internal/decrypter/decrypter.go | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index cea0bad..9702cb9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -59,5 +59,11 @@ issues: - G404 - G502 - G505 + exclude-rules: + - path: internal/browser/browser\.go + linters: + - 'deadcode' + - 'varcheck' + - 'unused' max-issues-per-linter: 0 max-same-issues: 0 diff --git a/internal/browser/browser.go b/internal/browser/browser.go index f8d2bb1..9dcd5c0 100644 --- a/internal/browser/browser.go +++ b/internal/browser/browser.go @@ -114,7 +114,6 @@ func ListBrowser() []string { // home dir path for all platforms var homeDir, _ = os.UserHomeDir() -//nolint:unused const ( chromeName = "Chrome" chromeBetaName = "Chrome Beta" diff --git a/internal/decrypter/decrypter.go b/internal/decrypter/decrypter.go index dbce6fe..97484c5 100644 --- a/internal/decrypter/decrypter.go +++ b/internal/decrypter/decrypter.go @@ -185,6 +185,7 @@ func (l loginPBE) Decrypt(globalSalt, masterPwd []byte) (key []byte, err error) func (l loginPBE) iv() []byte { return l.Data.IV } + func (l loginPBE) encrypted() []byte { return l.Encrypted }