For some reasons, I need to run go t.Run. However this triggers a runtime error: invalid memory address or nil pointer dereference:
package mypackage
import (
"sync"
"testing"
)
func TestParallel(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
go t.Run("subtest", func(t *testing.T) {
defer wg.Done()
})
wg.Wait()
}
(I test several things that must run in parallel, running t.Parallel my block some of my substests if I have more than GOXMAXPROCS)