Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatKV ¶
FormatKV produces a string with each key-pair formatted with the provided string. Trailing whitespace (and `,`) are treated as formatted string separators and is implicitly used to join the formatted strings together.
func NewContext ¶
func NewContext(testingT Cleanuper) (context.Context, context.CancelFunc)
NewContext creates a context that's cancelled when the testing.TB scope ends.
Types ¶
type Cleanuper ¶
type Cleanuper interface {
Cleanup(func())
}
Cleanuper describe types that can cleanup after themselves and that allow adding functions to be called when they're cleaning up. In practice, this is really just a scoped-down testing.TB.
type KV ¶
KV is a convenience type to hold, format, and log contextual data. Helpers are available both at the package level and on the type itself.
func (KV) Format ¶
Format formats the entire KV into a string. See FormatKV for details on format strings are handled.
type Logger ¶
type Logger interface {
Log(args ...any)
}
Logger describes types that can emit log messages. In practice, this is really just a scoped-down testing.TB.
type Terminator ¶
type Terminator interface {
Fatal(args ...any)
}
Terminator describes types that can log and terminate the test. In practice, this is really just a scoped-down testing.TB.