package main import ( "testing" ) func TestFoo(t *testing.T) { t.Parallel() // test code } func TestBar(t *testing.T) { t.Parallel() // test code } func TestBaz(t *testing.T) { t.Parallel() // test code } func TestQux(t *testing.T) { t.Parallel() // test code } func TestMain(m *testing.M) { // Set the maximum number of test cases to run in parallel testing.B.SetParallelism(2) m.Run() }In this example, four tests are defined, each marked with the `Parallel()` method. The `TestMain` function is used to set the maximum number of test cases to be run in parallel using the `testing.B.SetParallelism` method. In this case, we've set the parallelism to 2 to ensure that no more than two test cases are running concurrently. This example code is from the standard library package `testing` which is used for testing Go packages.