Documentation
¶
Index ¶
- Variables
- func AssertDirExists(t *testing.T, dir string)
- func AssertNotPanics(t *testing.T, f func())
- func AssertPanics(t *testing.T, f func())
- func ContextFromDeadline(ctx context.Context, t *testing.T, deadline time.Time) (context.Context, context.CancelFunc)
- func ContextFromT(ctx context.Context, t *testing.T) (context.Context, context.CancelFunc)
- func ContextFromTimeout(ctx context.Context, t *testing.T, timeout time.Duration) (context.Context, context.CancelFunc)
- func Must[T any](value T, err error) T
- func MustMkUnixTemp(socketName string) *url.URL
- func MustMkdirTemp() string
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTimeout = time.Second * 30
Functions ¶
func AssertDirExists ¶
func AssertNotPanics ¶
func AssertPanics ¶
func ContextFromDeadline ¶
func ContextFromT ¶
func ContextFromTimeout ¶
func Must ¶
Do takes a value of any type and an error. If the error is not nil, it panics with the given error. Otherwise, it returns the value. This function is useful for handling errors that are not expected to occur and can be safely ignored or handled with a panic.
Example:
result := must.Do(someFunction()) // If someFunction() returns an error, the program will panic with that error. // Otherwise, the result will be assigned the value returned by someFunction().
func MustMkUnixTemp ¶
func MustMkdirTemp ¶
func MustMkdirTemp() string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.