Help us shape the future of Go! Take the 2026 Go Developer Survey

assert

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package assert holds the handful of test helpers the core module uses.

It exists so that the root module keeps a completely empty dependency list, test dependencies included. Anything more elaborate than this belongs in a test, not in a helper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(t testing.TB, got, want any, what string)

DeepEqual fails the test unless got and want are deeply equal.

func Equal

func Equal[T comparable](t testing.TB, got, want T, what string)

Equal fails the test unless got and want are equal.

func Error

func Error(t testing.TB, err error, what string)

Error fails the test if err is nil.

func ErrorIs

func ErrorIs(t testing.TB, err, target error, what string)

ErrorIs fails the test unless err matches target under errors.Is.

func False

func False(t testing.TB, cond bool, what string)

False fails the test unless cond does not hold.

func NoError

func NoError(t testing.TB, err error, what string)

NoError fails the test if err is non-nil.

func True

func True(t testing.TB, cond bool, what string)

True fails the test unless cond holds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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