erkrequire

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package erkrequire wraps testify/require to test Kratos errors, handling the nil interface trap via erkadapt. Unlike erkassert, a failed check stops the test.

erkrequire 为 Kratos 错误封装 testify/require,经 erkadapt 处理 nil 接口陷阱; 与 erkassert 不同,断言失败会直接终止测试。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(t require.TestingT, erk *errors.Error, msgAndArgs ...interface{})

Error requires that erk is non-nil.

Error 要求 erk 非 nil。

func Is

func Is(t require.TestingT, expected *errors.Error, erk *errors.Error, msgAndArgs ...interface{})

Is requires that two Kratos errors match on nil state, Reason and Code.

Is 要求两个 Kratos 错误在 nil 状态、Reason 和 Code 上一致。

func NoError

func NoError(t require.TestingT, erk *errors.Error, msgAndArgs ...interface{})

NoError requires that erk is nil.

NoError 要求 erk 为 nil。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL