@@ -26,8 +26,8 @@ func TestExec_ContextTimeout(t *testing.T) {
2626 ctx , cancel := context .WithTimeout (context .Background (), 100 * time .Millisecond )
2727 defer cancel ()
2828
29- // Use cmd directly with a blocking stdin so the command starts
30- // successfully and blocks reading until the context deadline fires.
29+ // Use cmd directly with a blocking stdin so the command starts successfully and
30+ // blocks reading until the context deadline fires.
3131 c , timeoutCancel := cmd (ctx , "" , []string {"hash-object" , "--stdin" }, nil )
3232 defer timeoutCancel ()
3333
@@ -37,10 +37,10 @@ func TestExec_ContextTimeout(t *testing.T) {
3737 })
3838}
3939
40- // blockingReader is an io.Reader that blocks until its cancel channel is
41- // closed, simulating a stdin that never provides data. When cancelled it
42- // returns io.EOF so that the stdin copy goroutine can exit cleanly,
43- // allowing cmd.Wait() to return.
40+ // blockingReader is an io.Reader that blocks until its cancel channel is closed,
41+ // simulating a stdin that never provides data. When canceled it returns io.EOF
42+ // so that the stdin copy goroutine can exit cleanly, allowing cmd.Wait() to
43+ // return.
4444type blockingReader struct {
4545 cancel <- chan struct {}
4646}
@@ -53,8 +53,8 @@ func (r blockingReader) Read(p []byte) (int, error) {
5353func TestCmd_ContextCancellation (t * testing.T ) {
5454 ctx , cancel := context .WithCancel (context .Background ())
5555
56- // Cancel in the background after a short delay so the command is already
57- // running when cancellation arrives. Close done to unblock the reader.
56+ // Cancel in the background after a short delay so the command is already running
57+ // when cancellation arrives. Close done to unblock the reader.
5858 done := make (chan struct {})
5959 go func () {
6060 time .Sleep (50 * time .Millisecond )
@@ -73,9 +73,9 @@ func TestCmd_ContextCancellation(t *testing.T) {
7373}
7474
7575func TestExec_DefaultTimeoutApplied (t * testing.T ) {
76- // A plain context.Background() has no deadline. The command should still
77- // succeed because DefaultTimeout (1 min) is applied automatically and
78- // "git version" completes well within that.
76+ // A plain context.Background() has no deadline. The command should still succeed
77+ // because DefaultTimeout is applied automatically and "git version" completes
78+ // well within that.
7979 ctx := context .Background ()
8080 stdout , err := exec (ctx , "" , []string {"version" }, nil )
8181 assert .NoError (t , err )
0 commit comments