Documentation
¶
Overview ¶
Package mainthread runs the tests of a macOS program on the main thread: AppKit works only there (SPEC §29.3), and the Go test runner runs every test on a goroutine of its own. A test binary that opens windows calls Main from TestMain; its tests then call Do, which runs a function on the main thread and waits for it. Only tests import it (it has no use in a program, which calls Run from main).
Flutter: no counterpart
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
func Do(fn func())
Do runs fn on the main thread and returns when it has returned. A panic of fn is raised again in the caller. fn must not call t.Fatal or runtime.Goexit: that would end the main thread's loop; it reports with t.Error and returns, and a test that waits for events does so in its own goroutine.
Flutter: no counterpart
Types ¶
This section is empty.