Skip to content

Commit 1b68176

Browse files
fix(ci): move G118 nosec annotation to goroutine launch line
1 parent b0ea215 commit 1b68176

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/covenantsigner/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ func Initialize(
141141
return nil, false, fmt.Errorf("failed to bind covenant signer port [%d]: %w", config.Port, err)
142142
}
143143

144-
go func() { // #nosec G118 -- parent ctx is already cancelled; shutdown needs a fresh deadline
144+
// #nosec G118 -- this goroutine intentionally uses context.Background for
145+
// the shutdown drain. ctx is already cancelled when <-ctx.Done() unblocks;
146+
// using it for the Shutdown timeout would cause immediate cancellation.
147+
go func() {
145148
<-ctx.Done()
146149

147150
// Cancel the service context so in-flight threshold signing
148151
// operations observe shutdown and terminate promptly.
149152
cancelService()
150153

151-
// #nosec G118 -- context.Background is required here because ctx is
152-
// already cancelled at this point; using it would make Shutdown return
153-
// immediately with context.Canceled before the drain completes.
154154
shutdownCtx, cancelShutdown := context.WithTimeout(
155155
context.Background(),
156156
5*time.Second,

0 commit comments

Comments
 (0)