mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
fix: Fix stdin restoration in TestUserConfirmed
Signed-off-by: shangchengbabaiban <shuang.cui@live.cn>
This commit is contained in:
@@ -33,10 +33,11 @@ func TestUserConfirmed(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(string(tt.input), func(t *testing.T) {
|
||||
originalStdin := os.Stdin
|
||||
r, w, _ := os.Pipe()
|
||||
os.Stdin = r
|
||||
defer func() {
|
||||
os.Stdin = os.Stdin
|
||||
os.Stdin = originalStdin
|
||||
}()
|
||||
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user