Skip to content

Commit 6b7ca75

Browse files
committed
Enable contextcheck and intrange linters
1 parent 67e1f75 commit 6b7ca75

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.golangci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ linters:
1010
- unparam
1111
- gosec
1212
- tparallel
13+
- contextcheck
14+
- intrange
1315

1416
issues:
1517
exclude-dirs:

internal/bundler/metadata.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (m *MetadataSet) Write() error {
7676
// Build a list of fields
7777
fields := []string{}
7878
for field, o := range occurrences {
79-
for i := 0; i < o; i++ {
79+
for range o {
8080
fields = append(fields, field)
8181
}
8282
}

internal/package_/goa.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (w *goaWrapper) Reject(ctx context.Context, payload *goapackage.RejectPaylo
252252
signal := ReviewPerformedSignal{
253253
Accepted: false,
254254
}
255-
err = w.tc.SignalWorkflow(context.Background(), *goapkg.WorkflowID, "", ReviewPerformedSignalName, signal)
255+
err = w.tc.SignalWorkflow(ctx, *goapkg.WorkflowID, "", ReviewPerformedSignalName, signal)
256256
if err != nil {
257257
return goapackage.MakeNotAvailable(errors.New("cannot perform operation"))
258258
}

internal/storage/download.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package storage
22

33
import (
4-
"context"
54
"fmt"
65
"io"
76
"net/http"
@@ -35,7 +34,7 @@ func Download(svc Service, mux goahttp.Muxer, dec func(r *http.Request) goahttp.
3534
}
3635

3736
// Read storage package.
38-
ctx := context.Background()
37+
ctx := req.Context()
3938
pkg, err := svc.ReadPackage(ctx, aipID)
4039
if err != nil {
4140
rw.WriteHeader(http.StatusNotFound)

0 commit comments

Comments
 (0)