github.com/megatontech/mynoteforgo@v0.0.0-20200507084910-5d0c6ea6e890/源码/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  }