Skip to content

Commit

Permalink
fix gha tests
Browse files Browse the repository at this point in the history
Signed-off-by: Phani Rithvij <phanirithvij2000@gmail.com>
  • Loading branch information
phanirithvij committed Jun 9, 2024
1 parent 3f3822f commit 81e2784
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ linters-settings:
funlen:
lines: -1
statements: 100
errcheck:
exclude-functions:
- fmt.Fprintf
- fmt.Fprintln

linters:
enable-all: true
Expand Down Expand Up @@ -50,6 +54,7 @@ linters:
- lll
- maintidx
- maligned
- mnd
- musttag
- nilerr
- noctx
Expand Down
3 changes: 1 addition & 2 deletions pkg/hibp/api/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func Download(ctx context.Context, path string, keep bool) error {

sem := make(chan struct{}, runtime.NumCPU()*4)
wg := &sync.WaitGroup{}
for i := 0; i < max; i++ {
i := i
for i := range max {
wg.Add(1)
go func() {
sem <- struct{}{}
Expand Down
4 changes: 2 additions & 2 deletions pkg/hibp/dump/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (s *Scanner) scanUnsortedFile(ctx context.Context, fn string, in []string,
lines := make(chan string, 1024)
worker := runtime.NumCPU()
done := make(chan struct{}, worker)
for i := 0; i < worker; i++ {
for i := range worker {
debug.Log("[%d] Starting matcher ...", i)
go s.matcher(ctx, in, lines, results, done)
}
Expand All @@ -332,7 +332,7 @@ SCAN:
}
close(lines)

for i := 0; i < worker; i++ {
for range worker {
<-done
}

Expand Down

0 comments on commit 81e2784

Please sign in to comment.