Skip to content

Commit

Permalink
chore: require Go 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Oct 5, 2024
1 parent edd9d2d commit f8756f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: '1.22'
- name: build
run: go build ./...
- name: test
Expand All @@ -25,8 +23,6 @@ jobs:
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: '1.22'
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
with:
version: v1.56.2
version: v1.61.0
26 changes: 21 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
go: '1.22'
run:
go: '1.23'

linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupl
Expand All @@ -17,14 +20,14 @@ linters:
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- fatcontext
- forcetypeassert
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- gocritic
- godot
- gofmt
Expand All @@ -36,14 +39,18 @@ linters:
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
- ireturn
- loggercheck
- makezero
- mirror
- misspell
- musttag
- nakedret
Expand All @@ -53,28 +60,37 @@ linters:
- nolintlint
- nonamedreturns
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- thelper
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
disable:
- cyclop
- depguard
- err113
- exhaustruct
- forbidigo
- funlen
Expand All @@ -83,15 +99,15 @@ linters:
- goconst
- gocyclo
- godox
- goerr113
- gomnd
- lll
- maintidx
- maligned
- mnd
- nestif
- nlreturn
- paralleltest
- testpackage
- tparallel
- varnamelen
- wrapcheck
- wsl
Expand Down
8 changes: 3 additions & 5 deletions internal/dupfind/dupfinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (f *DupFinder) FindDuplicates() (map[string][]string, error) {
defer close(regularFilesCh)
var wg sync.WaitGroup
for _, root := range f.roots {
root := root
wg.Add(1)
go func() {
defer wg.Done()
Expand Down Expand Up @@ -232,7 +231,7 @@ func (f *DupFinder) concurrentWalkDir(root string, walkDirFunc fs.WalkDirFunc, e
files++
}
}
f.statistics.files.Add(uint64(files))
f.statistics.files.Add(uint64(files)) //nolint:gosec
var wg sync.WaitGroup
FOR:
for _, dirEntry := range dirEntries {
Expand Down Expand Up @@ -289,7 +288,7 @@ func (f *DupFinder) findRegularFiles(root string, regularFilesCh chan<- pathWith
return err
}
size := fileInfo.Size()
f.statistics.totalBytes.Add(uint64(size))
f.statistics.totalBytes.Add(uint64(size)) //nolint:gosec
regularFilesCh <- pathWithSize{
path: path,
size: size,
Expand Down Expand Up @@ -327,7 +326,7 @@ func (f *DupFinder) hashPath(p pathWithSize) (xxh3.Uint128, error) {
if err != nil {
return xxh3.Uint128{}, err
}
f.statistics.bytesHashed.Add(uint64(written))
f.statistics.bytesHashed.Add(uint64(written)) //nolint:gosec
return hash.Sum128(), nil
}

Expand All @@ -336,7 +335,6 @@ func (f *DupFinder) hashPath(p pathWithSize) (xxh3.Uint128, error) {
func (f *DupFinder) hashPaths(pathsWithHashCh chan<- pathWithHash, pathsToHashCh <-chan pathWithSize, errCh chan<- error) {
var wg sync.WaitGroup
for pathWithSize := range pathsToHashCh {
pathWithSize := pathWithSize
wg.Add(1)
go func() {
defer wg.Done()
Expand Down

0 comments on commit f8756f1

Please sign in to comment.