We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我有一个函数:
func Create () error{ return errors.WithCode(errcode.Create, "创建错误") }
测试中一般这样写:
testCases := []struct { name string wantErr error }{ name: "xxx", wantErr: errors.WithCode(errcode.Create, "创建错误") } } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T)) { err := Create() assert.Equal(t, tc.wantErr, err) } }
类似上面的并不会比较成功,现在只能人眼打印去看具体的信息,有什么优雅的方法吗?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我有一个函数:
测试中一般这样写:
类似上面的并不会比较成功,现在只能人眼打印去看具体的信息,有什么优雅的方法吗?
The text was updated successfully, but these errors were encountered: