chore: linter violations in test files for multiple linters

feat/library
moonD4rk 1 year ago
parent aa2e1af5b5
commit d87ef03ae0
No known key found for this signature in database
GPG Key ID: 5AB6217E08D39ABA
  1. 10
      .golangci.yml
  2. 6
      browser.go
  3. 9
      chromium.go
  4. 3
      chromium_test.go
  5. 4
      consts.go

@ -60,9 +60,15 @@ issues:
- G502
- G505
exclude-rules:
- path: browser/browser\.go
- path: _test\.go
linters:
- 'unused'
- gocyclo
- errcheck
- dupl
- gosec
- unparam
- staticcheck
- paralleltest
max-issues-per-linter: 0
max-same-issues: 0

@ -39,7 +39,7 @@ func (c *chromium) AllBrowsingData() ([]BrowserData, error) {
return nil, nil
}
func (f *firefox) BrowsingData(items []browserDataType) (BrowserData, error) {
func (f *firefox) BrowsingData(_ []browserDataType) (BrowserData, error) {
return nil, nil
}
@ -68,8 +68,7 @@ func (b browser) Type() browserType {
}
}
var (
browsers = map[browser]Browser{
var browsers = map[browser]Browser{
Chrome: &chromium{
name: Chrome,
storage: chromeStorageName,
@ -83,4 +82,3 @@ var (
},
Yandex: &chromium{},
}
)

@ -33,10 +33,7 @@ func (c *chromium) Init() error {
if err := c.initProfile(); err != nil {
return fmt.Errorf("profile path '%s' does not exist %w", c.profilePath, ErrBrowserNotExists)
}
if err := c.initMasterKey(); err != nil {
return err
}
return nil
return c.initMasterKey()
}
func (c *chromium) initBrowserData() error {
@ -94,9 +91,7 @@ func (c *chromium) findAllProfiles() ([]string, error) {
}
func (c *chromium) initMasterKey() error {
var (
stdout, stderr bytes.Buffer
)
var stdout, stderr bytes.Buffer
args := []string{"find-generic-password", "-wa", strings.TrimSpace(c.storage)}
cmd := exec.Command("security", args...) //nolint:gosec
cmd.Stdout = &stdout

@ -4,8 +4,7 @@ import (
"testing"
)
func TestChromium_Init(t *testing.T) {
func TestChromium_Init(_ *testing.T) {
}
func BenchmarkChromium_Init(b *testing.B) {

@ -17,9 +17,7 @@ const (
arcStorageName = "Arc"
)
var (
homeDir, _ = os.UserHomeDir()
)
var homeDir, _ = os.UserHomeDir()
var (
chromeProfilePath = homeDir + "/Library/Application Support/Google/Chrome/Default/"

Loading…
Cancel
Save