fp

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(checks ...error) error

All reports every failed check, one per line. Use this by default. Arguments are evaluated before the call. Use Steps if a later check reads data that an earlier check proved valid.

func BytesEqual

func BytesEqual(what string, got, want []byte) error

BytesEqual reports a length summary, not the payload. Test payloads are large and dumping them hides the failure.

func Each

func Each[T any](label string, items []T, check func(T) error) error

Each runs check on each item. A failure gets the item index.

func Equal

func Equal[T comparable](what string, got, want T) error

func ErrIs

func ErrIs(what string, got, want error) error

func False

func False(what string, cond bool) error

func Len

func Len[T any](what string, got []T, want int) error

func NoErr

func NoErr(what string, err error) error

func NotEqual

func NotEqual[T comparable](what string, got, unwanted T) error

func Steps

func Steps(checks ...func() error) error

Steps runs checks in order and stops at the first failure. Checks are deferred, so a failed step skips the steps after it.

func True

func True(what string, cond bool) error

func WantErr

func WantErr(what string, err error) error

WantErr fails when err is nil. Use for the error path of a test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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