bytedance / mockey

a simple and easy-to-use golang mock library
Apache License 2.0
618 stars 23 forks source link

Support Go 1.23 #59

Closed haoxins closed 3 weeks ago

haoxins commented 4 weeks ago

Describe the bug

When run with Go 1.23

link: github.com/bytedance/mockey/internal/monkey/common: invalid reference to runtime.sysAllocOS

See https://github.com/cloudwego/hertz/pull/1171

Sychorius commented 4 weeks ago

We will fix it in next release

Sychorius commented 3 weeks ago

@haoxins go1.23 disallows using //go:linkname so here we can not link to sysAllocOS directly You can add -ldflags=-checklinkname=0 into test command to temporarily bypass this restriction. We are trying to find a better way to fix it

haoxins commented 3 weeks ago

@haoxins go1.23 disallows using //go:linkname so here we can not link to sysAllocOS directly You can add -ldflags=-checklinkname=0 into test command to temporarily bypass this restriction. We are trying to find a better way to fix it

It works for me, thanks~

Sychorius commented 3 weeks ago

@haoxins Fixed in v1.2.11, you can upgrade go.mod dependency