Skip to content
New issue

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

failed to link __xgo_link_get_pc_name(requires xgo) #292

Open
saoDiSengTank opened this issue Dec 21, 2024 · 3 comments
Open

failed to link __xgo_link_get_pc_name(requires xgo) #292

saoDiSengTank opened this issue Dec 21, 2024 · 3 comments

Comments

@saoDiSengTank
Copy link

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)

@xhd2015
Copy link
Owner

xhd2015 commented Dec 22, 2024

你是怎么运行测试用例的?go版本是多少?

@saoDiSengTank
Copy link
Author

你是怎么运行测试用例的?go版本是多少?

直接点击Test方法上的Run Test,我的go版本是1.23

@xhd2015
Copy link
Owner

xhd2015 commented Dec 23, 2024

需要xgo test才行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants