gotest.tools/gotestsum@v1.11.0/testjson/internal/badmain/main_test.go (about)

     1  // +build stubpkg
     2  
     3  /*Package badmain fails in TestMain
     4   */
     5  package badmain
     6  
     7  import (
     8  	"fmt"
     9  	"os"
    10  	"testing"
    11  )
    12  
    13  func TestMain(m *testing.M) {
    14  	fmt.Fprintln(os.Stderr, "sometimes main can exit 2")
    15  	os.Exit(2)
    16  }