Skip to content

Commit

Permalink
refactor: Add .golangci.yml file and fix lint warnings (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonjek authored Apr 5, 2024
1 parent fb4e424 commit cba78ef
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
46 changes: 46 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
run:
concurrency: 4
deadline: 5m
timeout: 5m

output:
sort-results: true

linters:
enable:
- asciicheck
- depguard
- dupword
- durationcheck
- errorlint
- gosec
- gocritic
- gofmt
- gofumpt
- goimports
- misspell
- nolintlint
- predeclared
- revive
- testifylint
- unconvert

linters-settings:
depguard:
rules:
main:
deny:
- pkg: "io/ioutil"
desc: "Use corresponding 'os' or 'io' functions instead."
- pkg: "github.com/pkg/errors"
desc: "Use 'errors' or 'fmt' instead of github.com/pkg/errors"
- pkg: "golang.org/x/exp/slices"
desc: "Use 'slices' instead."
revive:
# https://github.com/mgechev/revive/blob/master/defaults.toml
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
rules:
# A lot of false positives: incorrectly identifies channel draining as "empty code block".
# See https://github.com/mgechev/revive/issues/386
- name: empty-block
disabled: true
7 changes: 2 additions & 5 deletions internal/tray/tray.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import (
"io"

"github.com/getlantern/systray"

"github.com/sonjek/mouse-stay-up/internal/config"
"github.com/sonjek/mouse-stay-up/internal/mouse"
"github.com/sonjek/mouse-stay-up/internal/utils"
)

var (
//go:embed icon.png
iconFile embed.FS
)
//go:embed icon.png
var iconFile embed.FS

func loadIcon() ([]byte, error) {
file, err := iconFile.Open("icon.png")
Expand Down

0 comments on commit cba78ef

Please sign in to comment.