Documentation
¶
Overview ¶
Package testutil holds shared helpers for the test suite: currently a single migrate-and-open database fixture (NewDB). It is imported only from _test.go files, so the goose dependency it pulls in never reaches the runtime binary. It is carved out of the strict internal depguard rule for the same reason the domain package is: its allowed imports differ (goose and testify, neither of which belongs in production code).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDB ¶
NewDB opens a fresh on-disk database in a temp directory and applies every migration from the repo's top-level migrations/ directory. The database is closed automatically when the test finishes.
The store package keeps its own copy of this helper: store's tests live in package store, and importing testutil (which imports store) from them would form an import cycle. Every other package uses NewDB.
Types ¶
This section is empty.