@@ -173,7 +173,7 @@ func TestWgoCmd_match(t *testing.T) {
173173 tt := tt
174174 t .Run (tt .description , func (t * testing.T ) {
175175 t .Parallel ()
176- wgoCmd , err := WgoCommand (context .Background (), tt .args )
176+ wgoCmd , err := WgoCommand (context .Background (), 0 , tt .args )
177177 if err != nil {
178178 t .Fatal (err )
179179 }
@@ -263,7 +263,7 @@ func TestWgoCmd_addDirsRecursively(t *testing.T) {
263263 tt := tt
264264 t .Run (tt .description , func (t * testing.T ) {
265265 t .Parallel ()
266- wgoCmd , err := WgoCommand (context .Background (), tt .args )
266+ wgoCmd , err := WgoCommand (context .Background (), 0 , tt .args )
267267 if err != nil {
268268 t .Fatal (err )
269269 }
@@ -457,7 +457,7 @@ func TestWgoCommands(t *testing.T) {
457457func TestWgoCmd_Run (t * testing.T ) {
458458 t .Run ("args" , func (t * testing.T ) {
459459 t .Parallel ()
460- wgoCmd , err := WgoCommand (context .Background (), []string {
460+ wgoCmd , err := WgoCommand (context .Background (), 0 , []string {
461461 "run" , "-exit" , "-dir" , "testdata/args" , "./testdata/args" , "apple" , "banana" , "cherry" ,
462462 })
463463 if err != nil {
@@ -478,7 +478,7 @@ func TestWgoCmd_Run(t *testing.T) {
478478
479479 t .Run ("build flags off" , func (t * testing.T ) {
480480 t .Parallel ()
481- wgoCmd , err := WgoCommand (context .Background (), []string {
481+ wgoCmd , err := WgoCommand (context .Background (), 0 , []string {
482482 "run" , "-exit" , "-dir" , "testdata/build_flags" , "./testdata/build_flags" ,
483483 })
484484 if err != nil {
@@ -499,7 +499,7 @@ func TestWgoCmd_Run(t *testing.T) {
499499
500500 t .Run ("build flags on" , func (t * testing.T ) {
501501 t .Parallel ()
502- wgoCmd , err := WgoCommand (context .Background (), []string {
502+ wgoCmd , err := WgoCommand (context .Background (), 0 , []string {
503503 "run" , "-exit" , "-dir" , "testdata/build_flags" , "-tags=bar" , "./testdata/build_flags" ,
504504 })
505505 if err != nil {
@@ -520,7 +520,7 @@ func TestWgoCmd_Run(t *testing.T) {
520520
521521 t .Run ("env" , func (t * testing.T ) {
522522 t .Parallel ()
523- cmd , err := WgoCommand (context .Background (), []string {
523+ cmd , err := WgoCommand (context .Background (), 0 , []string {
524524 "run" , "-exit" , "-dir" , "testdata/env" , "./testdata/env" ,
525525 })
526526 if err != nil {
@@ -547,7 +547,7 @@ func TestWgoCmd_Run(t *testing.T) {
547547 }
548548 os .RemoveAll (binPath )
549549 defer os .RemoveAll (binPath )
550- wgoCmd , err := WgoCommand (context .Background (), []string {
550+ wgoCmd , err := WgoCommand (context .Background (), 0 , []string {
551551 "-exit" , "-dir" , "testdata/hello_world" , "-file" , ".go" , "go" , "build" , "-o" , binPath , "./testdata/hello_world" ,
552552 "::" , binPath ,
553553 })
@@ -577,7 +577,7 @@ func TestWgoCmd_Run(t *testing.T) {
577577 }
578578 os .RemoveAll (binPath )
579579 defer os .RemoveAll (binPath )
580- wgoCmd , err := WgoCommand (ctx , []string {
580+ wgoCmd , err := WgoCommand (ctx , 0 , []string {
581581 "-exit" , "-dir" , "testdata/hello_world" , "-file" , ".go" , "go" , "build" , "-o" , binPath , "./testdata/hello_world" ,
582582 "::" , binPath ,
583583 })
@@ -601,7 +601,7 @@ func TestWgoCmd_Run(t *testing.T) {
601601 t .Parallel ()
602602 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
603603 defer cancel ()
604- wgoCmd , err := WgoCommand (ctx , []string {
604+ wgoCmd , err := WgoCommand (ctx , 0 , []string {
605605 "run" , "-dir" , "testdata/signal" , "./testdata/signal" ,
606606 })
607607 if err != nil {
@@ -627,7 +627,7 @@ func TestWgoCmd_Run(t *testing.T) {
627627 t .Parallel ()
628628 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
629629 defer cancel ()
630- wgoCmd , err := WgoCommand (ctx , []string {
630+ wgoCmd , err := WgoCommand (ctx , 0 , []string {
631631 "run" , "-dir" , "testdata/signal" , "./testdata/signal" , "-trap-signal" ,
632632 })
633633 if err != nil {
@@ -650,7 +650,7 @@ func TestWgoCmd_Run(t *testing.T) {
650650 t .Parallel ()
651651 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
652652 defer cancel ()
653- wgoCmd , err := WgoCommand (ctx , []string {
653+ wgoCmd , err := WgoCommand (ctx , 0 , []string {
654654 "-xfile" , "." , "echo" , "hello" ,
655655 })
656656 if err != nil {
@@ -673,7 +673,7 @@ func TestWgoCmd_Run(t *testing.T) {
673673 t .Parallel ()
674674 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
675675 defer cancel ()
676- wgoCmd , err := WgoCommand (ctx , []string {
676+ wgoCmd , err := WgoCommand (ctx , 0 , []string {
677677 "-xfile" , "." , "-postpone" , "echo" , "hello" ,
678678 })
679679 if err != nil {
@@ -702,7 +702,7 @@ func TestWgoCmd_FileEvent(t *testing.T) {
702702
703703 ctx , cancel := context .WithCancel (context .Background ())
704704 defer cancel ()
705- wgoCmd , err := WgoCommand (ctx , []string {"run" , "-dir" , "testdata/file_event" , "-file" , ".txt" , "./testdata/file_event" })
705+ wgoCmd , err := WgoCommand (ctx , 0 , []string {"run" , "-dir" , "testdata/file_event" , "-file" , ".txt" , "./testdata/file_event" })
706706 if err != nil {
707707 t .Fatal (err )
708708 }
@@ -784,7 +784,7 @@ func TestWgoCmd_Polling(t *testing.T) {
784784
785785 ctx , cancel := context .WithCancel (context .Background ())
786786 defer cancel ()
787- wgoCmd , err := WgoCommand (ctx , []string {"run" , "-dir" , "testdata/polling" , "-file" , ".txt" , "-poll" , "100ms" , "./testdata/polling" })
787+ wgoCmd , err := WgoCommand (ctx , 0 , []string {"run" , "-dir" , "testdata/polling" , "-file" , ".txt" , "-poll" , "100ms" , "./testdata/polling" })
788788 if err != nil {
789789 t .Fatal (err )
790790 }
@@ -857,7 +857,7 @@ func TestStdin(t *testing.T) {
857857 t .Parallel ()
858858 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
859859 defer cancel ()
860- wgoCmd , err := WgoCommand (ctx , []string {"run" , "-exit" , "-dir" , "testdata/stdin" , "-stdin" , "./testdata/stdin" })
860+ wgoCmd , err := WgoCommand (ctx , 0 , []string {"run" , "-exit" , "-dir" , "testdata/stdin" , "-stdin" , "./testdata/stdin" })
861861 if err != nil {
862862 t .Fatal (err )
863863 }
@@ -893,7 +893,7 @@ func TestShellWrapping(t *testing.T) {
893893 }
894894
895895 // Assert that WgoCommand handles the builtin (via shell wrapping).
896- wgoCmd , err := WgoCommand (context .Background (), []string {"-exit" , builtin })
896+ wgoCmd , err := WgoCommand (context .Background (), 0 , []string {"-exit" , builtin })
897897 if err != nil {
898898 t .Fatal (err )
899899 }
@@ -904,11 +904,11 @@ func TestShellWrapping(t *testing.T) {
904904}
905905
906906func TestHelp (t * testing.T ) {
907- _ , err := WgoCommand (context .Background (), []string {"-h" })
907+ _ , err := WgoCommand (context .Background (), 0 , []string {"-h" })
908908 if ! errors .Is (err , flag .ErrHelp ) {
909909 t .Errorf ("expected flag.ErrHelp, got %#v" , err )
910910 }
911- _ , err = WgoCommand (context .Background (), []string {"run" , "-h" })
911+ _ , err = WgoCommand (context .Background (), 0 , []string {"run" , "-h" })
912912 if ! errors .Is (err , flag .ErrHelp ) {
913913 t .Errorf ("expected flag.ErrHelp, got %#v" , err )
914914 }
0 commit comments