invariant

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package invariant provides helpers for checking and panicing on faulty invariants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(b bool, msg string)

Check will raise an error with the provided message in case b is false.

func CheckNot

func CheckNot(b bool, msg string)

CheckNot will raise an error with the provided message in case b is true.

func CheckNotf

func CheckNotf(b bool, msgAndArgs ...interface{})

CheckNotf will raise an error with the provided message in case b is true. CheckNotf accept a fmt.Sprintf compatible format string with parameters.

func Checkf

func Checkf(b bool, msgAndArgs ...interface{})

Checkf will raise an error in case b is false. Checkf accept a fmt.Sprintf compatible format string with parameters.

func Unreachable

func Unreachable(msg string)

Unreachable marks some code sequence that must never be executed.

func Unreachablef

func Unreachablef(f string, vs ...interface{})

Unreachablef marks some code sequence that must never be executed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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