Skip to content

Commit ab35c0f

Browse files
authored
Merge pull request #460 from sapcc/fix-lints
2 parents 6a85a90 + 975489c commit ab35c0f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

pkg/actors/scraper.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@ func (s *Scraper) Run(ctx context.Context) {
7474
case "/":
7575
c := make(chan objects.FileSpec, 10)
7676
var wg sync.WaitGroup
77-
wg.Add(1)
78-
go func() {
77+
wg.Go(func() {
7978
for entry := range c {
8079
handleFileSpec(entry)
8180
}
82-
wg.Done()
83-
}()
81+
})
8482

8583
err = job.Source.ListAllFiles(ctx, c)
8684
close(c) // terminate receiver loop

pkg/util/http.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"errors"
99
"fmt"
1010
"io"
11+
"maps"
1112
"math"
1213
"net/http"
1314
"regexp"
@@ -119,9 +120,7 @@ func (d *downloader) buildRequest(ctx context.Context) (*http.Request, error) {
119120
if err != nil {
120121
return nil, err
121122
}
122-
for key, val := range d.RequestHeaders {
123-
req.Header[key] = val
124-
}
123+
maps.Copy(req.Header, d.RequestHeaders)
125124
return req, nil
126125
}
127126

0 commit comments

Comments
 (0)