contract

package
v3.40.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 3 Imported by: 215

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(cond bool)

Assert checks a condition and Fails if it is false.

func AssertNoError

func AssertNoError(err error)

AssertNoError will Fail if the error is non-nil.

func AssertNoErrorf

func AssertNoErrorf(err error, msg string, args ...interface{})

AssertNoErrorf will Fail if the error is non-nil, adding the additional log message.

func Assertf

func Assertf(cond bool, msg string, args ...interface{})

Assertf checks a condition and Failfs if it is false, formatting and logging the given message.

func Fail

func Fail()

Fail unconditionally abandons the process.

func Failf

func Failf(msg string, args ...interface{})

Failf unconditionally abandons the process, formatting and logging the given message.

func Ignore

func Ignore(v interface{})

Ignore explicitly ignores a value. This is similar to `_ = x`, but tells linters ignoring is intentional.

func IgnoreClose

func IgnoreClose(cr io.Closer)

IgnoreClose closes and ignores the returned error. This makes defer closes easier.

func IgnoreError

func IgnoreError(err error)

IgnoreError explicitly ignores an error. This is similar to `_ = x`, but tells linters ignoring is intentional. This routine is specifically for ignoring errors which is potentially more risky, and so logs at a higher level.

func Require

func Require(cond bool, param string)

Require checks a precondition condition pertaining to a function parameter, and Fails if it is false.

func Requiref

func Requiref(cond bool, param string, msg string, args ...interface{})

Requiref checks a precondition condition pertaining to a function parameter, and Failfs if it 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