skit

package module
v0.0.0-...-03ea71d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func ErrFormat(textFormat string, args ...interface{}) error

ErrFormat creates a new formatted error with the given format and arguments. This is a simple wrapper around fmt.Errorf.

func ErrNew

func ErrNew(text string) error

ErrNew creates a new error with the given text. This is a simple wrapper around errors.New.

func ErrWrap

func ErrWrap(err error, text string) error

ErrWrap wraps an existing error with additional context text.

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 Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to the given value.

func Require

func Require(t testing.TB, expected error, actual error, msgAndArgs ...any)

Require asserts that actual matches expected error.

func RequireNil

func RequireNil(t testing.TB, err error, msgAndArgs ...any)

RequireNil asserts that err is nil.

func RequireNotNil

func RequireNotNil(t testing.TB, err error, msgAndArgs ...any)

RequireNotNil asserts that err is not nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL