Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SafeGoroutineTester ¶
type SafeGoroutineTester struct{}
SafeGoroutineTester is an implementation of the mock ... interface which can be used to use the mock functions in another go routine.
The major issue is that the golang mock framework uses t.Fatalf() which causes a deadlock when called in another goroutine. To avoid this issue, this simple implementation prints the error then panics, which avoids the deadlock.
func (*SafeGoroutineTester) Errorf ¶
func (s *SafeGoroutineTester) Errorf(format string, args ...interface{})
Errorf prints the error to the screen then panics
func (*SafeGoroutineTester) Fatalf ¶
func (s *SafeGoroutineTester) Fatalf(format string, args ...interface{})
Fatalf prints the error to the screen then panics
Click to show internal directories.
Click to hide internal directories.