Skip to content

Commit 8471555

Browse files
committed
Revert "Move CloseStdin into clibase"
This reverts commit 65cdbcc.
1 parent d1cb325 commit 8471555

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

cli/clibase/cmd.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,6 @@ func (inv *Invocation) run(state *runState) error {
381381
return nil
382382
}
383383

384-
// CloseStdin closes the invocation's Stdin if it is an io.Closer.
385-
func (inv *Invocation) CloseStdin() error {
386-
// If we don't close Stdin, the io.Copy below may
387-
// block indefinitely on Stdin Read.
388-
if rc, ok := inv.Stdin.(io.Closer); ok {
389-
return rc.Close()
390-
}
391-
return nil
392-
}
393-
394384
type RunCommandError struct {
395385
Cmd *Cmd
396386
Err error

cli/ssh.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ func (r *RootCmd) ssh() *clibase.Cmd {
219219
rawSSH.Close()
220220
// If we don't close Stdin, the io.Copy below may
221221
// block indefinitely on Stdin Read.
222-
_ = inv.CloseStdin()
222+
if rc, ok := inv.Stdin.(io.Closer); ok {
223+
rc.Close()
224+
}
223225
return nil
224226
}, logger, client, workspace)
225227
}()

0 commit comments

Comments
 (0)