Skip to content

Commit

Permalink
lint: update linter config and address minor warns
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 9, 2024
1 parent a080755 commit c3951be
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: v1.61

- name: install goveralls
run: |
Expand Down
32 changes: 21 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
run:
timeout: 5m
tests: false

linters-settings:
govet:
enable:
- shadow
gocyclo:
min-complexity: 15
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -20,37 +20,47 @@ linters-settings:
- experimental
disabled-checks:
- wrapperFunc
- hugeParam
- rangeValCopy
- singleCaseSwitch
- ifElseChain

linters:
enable:
- staticcheck
- gosimple
- revive
- govet
- unconvert
- staticcheck
- unused
- gosec
- gocyclo
- dupl
- misspell
- unparam
- typecheck
- ineffassign
- stylecheck
- gochecknoinits
- exportloopref
- copyloopvar
- gocritic
- nakedret
- gosimple
- prealloc
fast: false
disable-all: true

issues:
exclude-dirs:
- vendor
exclude-rules:
- text: 'Deferring unsafe method "Close" on type "io.ReadCloser"'
- text: "at least one file in a package should have a package comment"
linters:
- gosec
- stylecheck
- text: "should have a package comment"
linters:
- revive
- path: _test\.go
linters:
- gosec
- dupl
exclude-use-default: false
exclude-use-default: false

2 changes: 1 addition & 1 deletion basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func GenerateBcryptHash(password string) (string, error) {
}

// GenerateArgon2Hash generates an argon2 hash and salt from a password
func GenerateArgon2Hash(password string) (hash string, salt string, err error) {
func GenerateArgon2Hash(password string) (hash, salt string, err error) {
saltBytes := make([]byte, 16)
if _, err := rand.Read(saltBytes); err != nil {
return "", "", err
Expand Down

0 comments on commit c3951be

Please sign in to comment.