Documentation
¶
Index ¶
- func Deref[T any](p *T) T
- func DerefOr[T any](p *T, def T) T
- func ErrFormat(textFormat string, args ...interface{}) error
- func ErrNew(text string) error
- func ErrWrap(err error, text string) error
- func ExecTx(ctx context.Context, dbc *sql.DB, opts *sql.TxOptions, ...) (err error)
- func Ptr[T any](v T) *T
- func Require(t testing.TB, expected error, actual error, msgAndArgs ...any)
- func RequireNil(t testing.TB, err error, msgAndArgs ...any)
- func RequireNotNil(t testing.TB, err error, msgAndArgs ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deref ¶
func Deref[T any](p *T) T
Deref returns the value pointed to by p, or the zero value of T if p is nil.
func DerefOr ¶
func DerefOr[T any](p *T, def T) T
DerefOr returns the value pointed to by p, or def if p is nil.
func ErrFormat ¶
ErrFormat creates a new formatted error with the given format and arguments. This is a simple wrapper around fmt.Errorf.
func ErrNew ¶
ErrNew creates a new error with the given text. This is a simple wrapper around errors.New.
func ExecTx ¶
func ExecTx(ctx context.Context, dbc *sql.DB, opts *sql.TxOptions, fn func(tx *sql.Tx) error) (err error)
ExecTx executes the given function within a database transaction.
func RequireNil ¶
RequireNil asserts that err is nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.