type InternalExample … // RunExamples is an internal function but exported because it is cross-package; // it is part of the implementation of the "go test" command. func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) { … } func runExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ran, ok bool) { … } func sortLines(output string) string { … } // processRunResult computes a summary and status of the result of running an example test. // stdout is the captured output from stdout of the test. // recovered is the result of invoking recover after running the test, in case it panicked. // // If stdout doesn't match the expected output or if recovered is non-nil, it'll print the cause of failure to stdout. // If the test is chatty/verbose, it'll print a success message to stdout. // If recovered is non-nil, it'll panic with that value. // If the test panicked with nil, or invoked runtime.Goexit, it'll be // made to fail and panic with errNilPanicOrGoexit func (eg *InternalExample) processRunResult(stdout string, timeSpent time.Duration, finished bool, recovered any) (passed bool) { … }