Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SafeDefer ¶
SafeDefer calls the given function (typically a close/rollback) and logs if it returns an error. Designed to be used in defer statements.
func Test ¶
func Test(t TestingLog) *sql.DB
Test creates a database for the given test. It does this by extracting the package under test, and creating and caching a database. If two tests call the Database method, only a single database is created.
Types ¶
type TestingLog ¶
type TestingLog interface {
zerolog.TestingLog
FailNow()
Name() string
Cleanup(func())
}
Click to show internal directories.
Click to hide internal directories.