...

Text file src/cmd/go/testdata/script/test_example_goexit.txt

Documentation: cmd/go/testdata/script

     1# For issue golang.org/issue/41084
     2[short] skip
     3
     4! go test -v examplegoexit
     5stdout '(?s)--- PASS.*--- FAIL.*'
     6stdout 'panic: test executed panic\(nil\) or runtime\.Goexit'
     7
     8-- go.mod --
     9module examplegoexit
    10
    11go 1.16
    12-- example_test.go --
    13package main
    14
    15import (
    16	"fmt"
    17	"runtime"
    18)
    19
    20func ExamplePass() {
    21	fmt.Println("pass")
    22	// Output:
    23	// pass
    24}
    25
    26func ExampleGoexit() {
    27	runtime.Goexit()
    28	// Output:
    29}

View as plain text