Skip to content

Commit e145792

Browse files
dgageotclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 1a8e453 commit e145792

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/root/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (f *apiFlags) runAPICommand(cmd *cobra.Command, args []string) error {
9494
// Monitor stdin for EOF to detect parent process death.
9595
// Only enabled when --exit-on-stdin-eof flag is passed.
9696
// When spawned with piped stdio, stdin closes when the parent process dies.
97-
if f.exitOnStdinEOF && stdin != nil {
97+
if f.exitOnStdinEOF {
9898
var cancel context.CancelFunc
9999
ctx, cancel = context.WithCancel(ctx)
100100
defer cancel()

0 commit comments

Comments
 (0)