Documentation ¶
Index ¶
- func Assert(cond interface{}, code int, msg any, args ...interface{}) error
- func AssertContains[T comparable](v T, a []T, code int, msg any, args ...interface{}) error
- func AssertContainsFunc[T any](a []T, f func(T) (in bool), code int, msg any, args ...interface{}) error
- func AssertEqual[T comparable](a, b T, code int, msg any, args ...interface{}) error
- func AssertNil(v any, code int, msg any, args ...interface{}) error
- func AssertNotNil(v any, code int, msg any, args ...interface{}) error
- func Fail(code int, msg any, args ...interface{}) (err error)
- type HttpError
- type ServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert asserts that the condition is true if the condition is false, it panics with the message
func AssertContains ¶
func AssertContains[T comparable](v T, a []T, code int, msg any, args ...interface{}) error
Contains asserts that the value is in the slice if the value is not in the slice, it panics with the message
func AssertContainsFunc ¶
func AssertContainsFunc[T any](a []T, f func(T) (in bool), code int, msg any, args ...interface{}) error
ContainsFunc asserts that the value is in the slice if the value is not in the slice, it panics with the message
func AssertEqual ¶
func AssertEqual[T comparable](a, b T, code int, msg any, args ...interface{}) error
Equal asserts that the two values are equal if the two values are not equal, it panics with the message
func AssertNil ¶ added in v1.6.8
AssertNil asserts that the value is nil if the value is not nil, it panics with the message
func AssertNotNil ¶ added in v1.6.8
AssertNotNil asserts that the value is not nil if the value is nil, it panics with the message
Types ¶
type ServerError ¶
func GetServerError ¶
func GetServerError(err error) ServerError
func NewServerError ¶
func NewServerError(code int, msg any) ServerError
Click to show internal directories.
Click to hide internal directories.