mustbe

package
v0.0.0-...-98bbd2d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package mustbe provides assertions that panic on violation.

This serves two purposes:

  1. Failing fast.
  2. Remove unnecessary branches and the temptation to test them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T comparable](x, y T)

Equal panics if the items are not equal.

func NoError

func NoError(err error)

NoError panics if the provided error is not nil.

func NotNil

func NotNil(v interface{})

NotNil panics if the value is nil.

func True

func True(ok bool)

True panics if the condition is false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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