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

panic: permission denied;go test ./main_test.go -gcflags=all=-l #113

Open
muzig opened this issue Oct 8, 2022 · 1 comment
Open

panic: permission denied;go test ./main_test.go -gcflags=all=-l #113

muzig opened this issue Oct 8, 2022 · 1 comment

Comments

@muzig
Copy link

muzig commented Oct 8, 2022

goroutine 4 [running]:
testing.tRunner.func1.2({0x100bcf660, 0x100c89988})
/Users//.gvm/gos/go1.18.5/src/testing/testing.go:1389 +0x1c8
testing.tRunner.func1()
/Users//.gvm/gos/go1.18.5/src/testing/testing.go:1392 +0x384
panic({0x100bcf660, 0x100c89988})
/Users//.gvm/gos/go1.18.5/src/runtime/panic.go:838 +0x218
github.com/agiledragon/gomonkey/v2.modifyBinary(0x18?, {0x14000018108, 0x18, 0x8?})
/Users//Documents/tap4fun/c6/gs/vendor/github.com/agiledragon/gomonkey/v2/modify_binary_darwin.go:9 +0xac
github.com/agiledragon/gomonkey/v2.replace(0x100bc3c60?, 0x100be5b78?)
/Users//Documents/tap4fun/c6/gs/vendor/github.com/agiledragon/gomonkey/v2/patch.go:269 +0x78
github.com/agiledragon/gomonkey/v2.(*Patches).ApplyCore(0x1400000c090, {0x100bc3c60?, 0x100be5b70?, 0x14000010480?}, {0x100bc3c60?, 0x100be5b78?, 0x100be68c8?})
/Users//Documents/tap4fun/c6/gs/vendor/github.com/agiledragon/gomonkey/v2/patch.go:213 +0x80
github.com/agiledragon/gomonkey/v2.(*Patches).ApplyFunc(0x14000098ef8?, {0x100bc3c60?, 0x100be5b70?}, {0x100bc3c60, 0x100be5b78})
/Users//Documents/tap4fun/c6/gs/vendor/github.com/agiledragon/gomonkey/v2/patch.go:83 +0x74
github.com/agiledragon/gomonkey/v2.ApplyFunc({0x100bc3c60, 0x100be5b70}, {0x100bc3c60, 0x100be5b78})
/Users//Documents/tap4fun/c6/gs/vendor/github.com/agiledragon/gomonkey/v2/patch.go:25 +0x44
command-line-arguments.TestName(0x0?)
/Users//Documents/tap4fun/c6/gs/tmp/main_test.go:20 +0x48
testing.tRunner(0x14000120340, 0x100be5b80)
/Users//.gvm/gos/go1.18.5/src/testing/testing.go:1439 +0x118
created by testing.(*T).Run
/Users//.gvm/gos/go1.18.5/src/testing/testing.go:1486 +0x2d8
FAIL command-line-arguments 0.085s
FAIL

The test code:

`
package main

import (
"testing"

"github.com/agiledragon/gomonkey/v2"

)

func TestName(t *testing.T) {
Print()
p := gomonkey.ApplyFunc(Print, func() {
t.Logf("b")
})
defer p.Reset()

Print()

}

func Print() {
}

`

image

@muzig muzig changed the title panic: permission denied panic: permission denied;go test ./tmp/main_test.go -gcflags=all=-l Oct 8, 2022
@muzig muzig changed the title panic: permission denied;go test ./tmp/main_test.go -gcflags=all=-l panic: permission denied;go test ./main_test.go -gcflags=all=-l Oct 8, 2022
@fivezh
Copy link

fivezh commented Oct 9, 2022

apple m1下arm64下应该是老问题了,参考:#70

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