Skip to content

Commit 5899033

Browse files
michaelmcneesclaude
andcommitted
fix: move #nosec G118 annotation to goroutine line where gosec flags it
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 27cac6d commit 5899033

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

internal/connector/docker.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,11 @@ func (c *DockerRunConnector) Execute(ctx context.Context, params map[string]any)
292292
// Handle context cancellation → container stop.
293293
doneCh := make(chan struct{})
294294
defer close(doneCh)
295-
go func() {
295+
go func() { // #nosec G118 -- intentional context.Background: parent ctx is cancelled, need a live context to stop the container
296296
select {
297297
case <-ctx.Done():
298298
gracePeriod := 10
299-
// Use Background because the parent ctx is already cancelled — we need a live context to stop the container.
300-
cli.ContainerStop(context.Background(), containerID, container.StopOptions{ // #nosec G118 -- intentional: parent ctx is cancelled
299+
cli.ContainerStop(context.Background(), containerID, container.StopOptions{
301300
Timeout: &gracePeriod,
302301
})
303302
case <-doneCh:

0 commit comments

Comments
 (0)