@@ -281,7 +281,7 @@ func TestContainerPTY(t *testing.T) {
281281 }
282282 defer container .Delete (ctx , WithSnapshotCleanup )
283283
284- direct , err := newDirectIOWithTerminal (ctx )
284+ direct , err := newDirectIO (ctx , true )
285285 if err != nil {
286286 t .Fatal (err )
287287 }
@@ -360,7 +360,7 @@ func TestContainerAttach(t *testing.T) {
360360
361361 expected := "hello" + newLine
362362
363- direct , err := newDirectIOStandard (ctx )
363+ direct , err := newDirectIO (ctx , false )
364364 if err != nil {
365365 t .Fatal (err )
366366 }
@@ -429,24 +429,12 @@ func TestContainerAttach(t *testing.T) {
429429 }
430430}
431431
432- func newDirectIOStandard (ctx context.Context ) (* directIO , error ) {
433- return newDirectIO (ctx , false )
434- }
435-
436- func newDirectIOWithTerminal (ctx context.Context ) (* directIO , error ) {
437- return newDirectIO (ctx , true )
438- }
439-
440432func newDirectIO (ctx context.Context , terminal bool ) (* directIO , error ) {
441- fifos , err := cio .NewFIFOSetInDir ("" , "" , false )
433+ fifos , err := cio .NewFIFOSetInDir ("" , "" , terminal )
442434 if err != nil {
443435 return nil , err
444436 }
445- f := cio .NewDirectIO
446- if terminal {
447- f = cio .NewDirectIOWithTerminal
448- }
449- dio , err := f (ctx , fifos )
437+ dio , err := cio .NewDirectIO (ctx , fifos )
450438 if err != nil {
451439 return nil , err
452440 }
@@ -508,7 +496,7 @@ func TestContainerUsername(t *testing.T) {
508496 if err != nil {
509497 t .Fatal (err )
510498 }
511- direct , err := newDirectIOStandard (ctx )
499+ direct , err := newDirectIO (ctx , false )
512500 if err != nil {
513501 t .Fatal (err )
514502 }
@@ -583,7 +571,7 @@ func testContainerUser(t *testing.T, userstr, expectedOutput string) {
583571 if err != nil {
584572 t .Fatal (err )
585573 }
586- direct , err := newDirectIOStandard (ctx )
574+ direct , err := newDirectIO (ctx , false )
587575 if err != nil {
588576 t .Fatal (err )
589577 }
@@ -668,7 +656,7 @@ func TestContainerAttachProcess(t *testing.T) {
668656 expected := "hello" + newLine
669657
670658 // creating IO early for easy resource cleanup
671- direct , err := newDirectIOStandard (ctx )
659+ direct , err := newDirectIO (ctx , false )
672660 if err != nil {
673661 t .Fatal (err )
674662 }
@@ -775,7 +763,7 @@ func TestContainerUserID(t *testing.T) {
775763 if err != nil {
776764 t .Fatal (err )
777765 }
778- direct , err := newDirectIOStandard (ctx )
766+ direct , err := newDirectIO (ctx , false )
779767 if err != nil {
780768 t .Fatal (err )
781769 }
0 commit comments