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
Hi Team,
我第一次运行mock.Patch方法,报错 failed to link __xgo_link_get_pc_name(requires xgo)是什么问题? 下面是我的代码,就是一个简单的测试: func TestSendRequest(t *testing.T) { patches := gomonkey.NewPatches() defer patches.Reset() mock.Patch(aaa, func() (string, error) { return "asdacdcs", errors.New("testawdwex") }) s, err := aaa() fmt.Println("ssad", err) fmt.Println("cweD", s) panic("test") }
func aaa() (string, error) { return "", nil }
M1 Pro 芯片,系统是 15.1.1 (24B91)
The text was updated successfully, but these errors were encountered:
你是怎么运行测试用例的?go版本是多少?
Sorry, something went wrong.
直接点击Test方法上的Run Test,我的go版本是1.23
需要xgo test才行
No branches or pull requests
Hi Team,
我第一次运行mock.Patch方法,报错 failed to link __xgo_link_get_pc_name(requires xgo)是什么问题?
下面是我的代码,就是一个简单的测试:
func TestSendRequest(t *testing.T) {
patches := gomonkey.NewPatches()
defer patches.Reset()
mock.Patch(aaa, func() (string, error) {
return "asdacdcs", errors.New("testawdwex")
})
s, err := aaa()
fmt.Println("ssad", err)
fmt.Println("cweD", s)
panic("test")
}
func aaa() (string, error) {
return "", nil
}
M1 Pro 芯片,系统是 15.1.1 (24B91)
The text was updated successfully, but these errors were encountered: