refactor: add nolint comment

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ 2022-08-14 22:16:24 +08:00
parent 63fc3a656a
commit 14fd71005a
4 changed files with 6 additions and 9 deletions

View File

@ -114,6 +114,7 @@ func ListBrowser() []string {
// home dir path for all platforms
var homeDir, _ = os.UserHomeDir()
//nolint:unused
const (
chromeName = "Chrome"
chromeBetaName = "Chrome Beta"
@ -126,4 +127,6 @@ const (
coccocName = "CocCoc"
yandexName = "Yandex"
firefoxName = "Firefox"
speed360Name = "360speed"
qqBrowserName = "QQ"
)

View File

@ -6,11 +6,6 @@ import (
"hack-browser-data/internal/item"
)
const (
speed360Name = "360speed"
qqBrowserName = "QQ"
)
var (
chromiumList = map[string]struct {
name string

View File

@ -32,7 +32,9 @@ func (c *chromium) GetMasterKey() ([]byte, error) {
return nil, err
}
defer func() {
session.Close()
if err := session.Close(); err != nil {
log.Errorf("close session failed: %v", err)
}
}()
collections, err := svc.GetAllCollections()
if err != nil {

View File

@ -4,9 +4,6 @@ func Chromium(key, encryptPass []byte) ([]byte, error) {
if len(encryptPass) < 3 {
return nil, errPasswordIsEmpty
}
if len(key) == 0 {
return nil, errSecurityKeyIsEmpty
}
chromeIV := []byte{32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}
return aes128CBCDecrypt(key, chromeIV, encryptPass[3:])