github.com/zxy12/golang_with_comment@v0.0.0-20190701084843-0e6b2aff5ef3/cmd/go/testdata/standalone_parallel_sub_test.go (about)

     1  package standalone_parallel_sub_test
     2  
     3  import "testing"
     4  
     5  func Test(t *testing.T) {
     6  	ch := make(chan bool, 1)
     7  	t.Run("Sub", func(t *testing.T) {
     8  		t.Parallel()
     9  		<-ch
    10  		t.Run("Nested", func(t *testing.T) {})
    11  	})
    12  	// Ensures that Sub will finish after its t.Run call already returned.
    13  	ch <- true
    14  }