Skip to content

Commit

Permalink
update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Nov 1, 2024
1 parent 56201be commit c2501d6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: lint
run: go run github.com/ysmood/golangci-lint@latest
run: go run github.com/ysmood/golangci-lint@v0.13.0
if: matrix.os == 'ubuntu-latest'

- name: test
Expand Down
21 changes: 5 additions & 16 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
run:
skip-dirs-use-default: false

linters:
enable-all: true
disable:
Expand All @@ -22,18 +19,12 @@ linters:
- forcetypeassert
- gci
- depguard
- mnd

# Deprecated ones:
- structcheck
- interfacer
- deadcode
- varcheck
- ifshort
- exhaustivestruct
- golint
- maligned
- nosnakecase
- scopelint
- execinquery
- copyloopvar
- exportloopref
- copyloopvar

linters-settings:
gocyclo:
Expand All @@ -44,8 +35,6 @@ linters-settings:
lines: 100

issues:
exclude-use-default: false

exclude-rules:
- path: main.go
linters:
Expand Down
2 changes: 1 addition & 1 deletion batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (b *Batch) same(conf whisper.Config, inPath, outPath string) (bool, error)

previousDigest, err := os.ReadFile(digestPath)
if err != nil {
return false, nil //nolint: nilerr
return false, nil
}

return bytes.Equal(digest, previousDigest), nil
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/ysmood/whisper

go 1.21

toolchain go1.21.4
go 1.22

require (
github.com/ysmood/byframe/v4 v4.0.0
Expand Down
2 changes: 1 addition & 1 deletion lib/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func DecodeMeta(in io.Reader) (*Meta, error) {
// key num
_, num := byframe.DecodeHeader(numRaw)

for i := 0; i < num; i++ {
for i := range num {
key := make([]byte, meta.HashSize())

_, err = io.ReadFull(in, key)
Expand Down
2 changes: 1 addition & 1 deletion lib/secure/cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *Cipher) Decoder(r io.Reader) (io.ReadCloser, error) {
_, count := byframe.DecodeHeader(header)

encryptedKeys := [][]byte{}
for i := 0; i < count; i++ {
for range count {
encrypted, err := s.Next()
if err != nil {
return nil, err
Expand Down

0 comments on commit c2501d6

Please sign in to comment.