Skip to content

Commit a80e003

Browse files
Fix golangci-lint noctx error
pkg/logs/logs_test.go:270:23: os/exec.Command must not be called. use os/exec.CommandContext (noctx) cmd := exec.Command(os.Args[0], "-test.run=^TestLogs$", "-test.v") Signed-off-by: Richard Wall <[email protected]>
1 parent dd416a5 commit a80e003

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/logs/logs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ E0000 00:00:00.000000 00000 logs_test.go:000] "Contextual error" err="fake-err
267267

268268
for _, test := range tests {
269269
t.Run(test.name, func(t *testing.T) {
270-
cmd := exec.Command(os.Args[0], "-test.run=^TestLogs$", "-test.v")
270+
ctx := t.Context()
271+
cmd := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestLogs$", "-test.v")
271272
var (
272273
stdout bytes.Buffer
273274
stderr bytes.Buffer

0 commit comments

Comments
 (0)