From e145792869dc3230a1b58be3e9fe5dd59a21068c Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 10 Feb 2026 19:34:00 +0100 Subject: [PATCH] Remove redundant stdin nil check in api command The stdin variable is a copy of os.Stdin captured before it's set to nil, and os.Stdin is virtually always non-nil. The check provided no real protection and could confuse maintainers. Fixes #1665 Co-Authored-By: Claude Sonnet 4.5 --- cmd/root/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/root/api.go b/cmd/root/api.go index 9498ed821..ca0114142 100644 --- a/cmd/root/api.go +++ b/cmd/root/api.go @@ -94,7 +94,7 @@ func (f *apiFlags) runAPICommand(cmd *cobra.Command, args []string) error { // Monitor stdin for EOF to detect parent process death. // Only enabled when --exit-on-stdin-eof flag is passed. // When spawned with piped stdio, stdin closes when the parent process dies. - if f.exitOnStdinEOF && stdin != nil { + if f.exitOnStdinEOF { var cancel context.CancelFunc ctx, cancel = context.WithCancel(ctx) defer cancel()