contract

package
v3.81.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 225

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert deprecated

func Assert(cond bool)

Assert checks a condition and Fails if it is false.

Deprecated: Use Assertf.

func AssertNoError deprecated

func AssertNoError(err error)

AssertNoError will Fail if the error is non-nil.

Deprecated: Use AssertNoErrorf.

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 deprecated

func Fail()

Fail unconditionally abandons the process.

Deprecated: Use Failf.

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 deprecated

func Require(cond bool, param string)

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

Deprecated: Use Requiref.

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