Documentation
¶
Index ¶
- func Assert(cond bool)
- func CheckAndFatalIfError(err error, msg string)
- func GoAssertEqual(t *testing.T, expected, actual any, msg string)
- func GoAssertTrue(t *testing.T, bAssert bool, msg string)
- func SafeClose(closer io.Closer)
- func SafeCloseMsg(closer io.Closer, msg string)
- func Verify(err error) error
- func VerifyExcept1(err error, ex1 error) error
- func VerifyWithConfig(err error, config *Config) error
- func VerifyWithMessage(err error, msg string) error
- func VerifyWithResult[T any](result T, err error) T
- func VerifyWithResultEx[T any](result T, err error) (T, error)
- func VerifyWithTwoResult[R1 any, R2 any](r1 R1, r2 R2, err error) (R1, R2)
- func VerifyWithTwoResultEx[R1 any, R2 any](r1 R1, r2 R2, err error) (R1, R2, error)
- type CheckErrorAction
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndFatalIfError ¶
func GoAssertEqual ¶
TODO: compare with assert.equal
func SafeClose ¶
********************************************************************************************************************** * 注意: * 1.如果是通过 defer 调用的话, 定位出来的位置通常在调用函数的结束位置, 推荐使用 SafeCloseMsg() 方便定位 * 2.常见错误: * fs.ErrClosed <== *fs.PathError(close |0: file already closed) **********************************************************************************************************************
func SafeCloseMsg ¶
func VerifyExcept1 ¶
func VerifyWithConfig ¶
func VerifyWithMessage ¶
func VerifyWithResult ¶
func VerifyWithResultEx ¶
func VerifyWithTwoResult ¶
two result without error
Types ¶
type CheckErrorAction ¶
type CheckErrorAction int
const ( ACTION_FATAL_QUIT CheckErrorAction = iota ACTION_LOG_ERROR )
Click to show internal directories.
Click to hide internal directories.