testutil

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals[T any](t TB, a, b T)

func Error

func Error(t TB, err error)

func ErrorIs

func ErrorIs(t TB, got, want error)

func FatalIf

func FatalIf(t TB, c bool, f string, args ...any)

func JSONMarshalsTo added in v1.0.0

func JSONMarshalsTo[T any](t TB, obj T, want string)

JSONMarshalsTo asserts that obj marshals as JSON to the given string, allowing for formatting differences and displaying an easy-to-read diff.

func Must added in v1.0.0

func Must[T any](t T, err error) T

func OK

func OK(t TB, err error)

func Panic

func Panic(t TB, f func())

Types

type TB

type TB interface {
	Helper()
	Fatalf(format string, args ...any)
}

Jump to

Keyboard shortcuts

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