package
module
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Jun 14, 2021
License: BSD-2-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 12
Opens a new window with list of known importers.
README
¶
assert
Simple library for run-time assertions in Go.
Documentation
¶
Assert panics with Error if cond is false.
func AssertNotNil(v interface{})
AssertNotNil is a compatibility alias for NotNil.
func Assertf(cond bool, format string, v ...interface{})
Assertf panics with Error if cond is false.
func NotNil(v interface{})
NotNil takes a pointer to a nil-able type (pointer, interface, etc) and
panics with Error if the pointed-to value is nil.
func Raisef(format string, v ...interface{})
Raisef panics with Error.
type AssertionError = Error
AssertionError is a compatibility alias for Error.
type Error struct {
Text string
}
Error is the error type for Assert failure panics.
Error fulfills the error interface.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.