-
Notifications
You must be signed in to change notification settings - Fork 178
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; While adding export GOARCH=amd64 debugger is not working. Apple M1 Pro #112
Comments
Did you add Package path: github.com/agiledragon/gomonkey/v2/test Working directory: .../test Goland: 2022.2.3 on MacOS 12.6 on M1 Instead, the issue I'm having is that a can't actually debug: the tests run fine, but in Debug mode, it doesn't stop at my breakpoints. I should clarify, though, that I only managed to get the tests in the There seem to be limitations on using pointer receivers - only methods with value receivers are discovered as far as I could tell (by single-stepping into Patching a private method simply is not happening. I've tried every variation of a closure I could think of. I tried to move the return patch into a separate func. My methods take multiple paramaters (as pointers) and return multiple values. All "examples" in the test for private methods use far too simple case - no passed-in parameters for the methods and single return values. This package could be a god-send and the ability to do proper monkey patching would be fantastic, but after wasting hours on this, I give up: at this time, the package is not complete enough to support this in all situations. If you have a different experience, by all means post it here, I'd love to see it! |
@Marakai I tried to run the multiple test case after adding I think your package is github.com/agiledragon/gomonkey/v2/test whereas I have used github.com/agiledragon/gomonkey/v2. Package version: github.com/agiledragon/gomonkey/v2 v2.8.0
|
While running a test case of monkey patching I am getting the below error (go test ./...) :
--- FAIL: TestInquirySuite (0.01s) --- FAIL: TestInquirySuite/TestCore_CreateInquiryController (0.00s) suite.go:77: test panicked: permission denied goroutine 13 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x68 github.com/stretchr/testify/suite.failOnPanic(0x14000682ea0, {0x1037f8d00, 0x103e5b3a8}) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/stretchr/testify/suite/suite.go:77 +0x38 github.com/stretchr/testify/suite.Run.func1.1() /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/stretchr/testify/suite/suite.go:161 +0x1f0 panic({0x1037f8d00, 0x103e5b3a8}) /usr/local/go/src/runtime/panic.go:838 +0x204 github.com/agiledragon/gomonkey/v2.modifyBinary(0x1034d5650, {0x140001dabd0, 0x18, 0xd695af4ba0afdf5f?}) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/agiledragon/gomonkey/v2/modify_binary_darwin.go:9 +0xa4 github.com/agiledragon/gomonkey/v2.replace(0x1034d5650, 0x140004049f0?) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/agiledragon/gomonkey/v2/patch.go:256 +0x8c github.com/agiledragon/gomonkey/v2.(*Patches).ApplyCore(0x14000404530, {0x1037cfe80?, 0x1400019cf38?, 0x0?}, {0x1037cfe80?, 0x1038d9d18?, 0x0?}) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/agiledragon/gomonkey/v2/patch.go:218 +0xe8 github.com/agiledragon/gomonkey/v2.(*Patches).ApplyMethod(0x0?, {0x1038bd180, 0x10388c720}, {0x10351ae49, 0x26}, {0x1037cfe80?, 0x1038d9d18?}) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/agiledragon/gomonkey/v2/patch.go:92 +0x1c4 github.com/agiledragon/gomonkey/v2.ApplyMethod(...) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/agiledragon/gomonkey/v2/patch.go:29 quotation-service/inquiry/channel/delphius/core.(*InquiryTestSuite).TestCore_CreateInquiryController(0x140004b9440) /Users/avinash/Desktop/Backend/quotation-service/inquiry/channel/delphius/core/core_test.go:389 +0x1ec reflect.Value.call({0x1400019e9c0?, 0x1400019c560?, 0x13?}, {0x1034f12f3, 0x4}, {0x140000dde68, 0x1, 0x1?}) /usr/local/go/src/reflect/value.go:556 +0x5e4 reflect.Value.Call({0x1400019e9c0?, 0x1400019c560?, 0x140004b9440?}, {0x1400058b668, 0x1, 0x1}) /usr/local/go/src/reflect/value.go:339 +0x98 github.com/stretchr/testify/suite.Run.func1(0x14000682ea0) /Users/avinash/Desktop/Backend/quotation-service/vendor/github.com/stretchr/testify/suite/suite.go:175 +0x3e8 testing.tRunner(0x14000682ea0, 0x140004df170) /usr/local/go/src/testing/testing.go:1439 +0x110 created by testing.(*T).Run /usr/local/go/src/testing/testing.go:1486 +0x300
While Adding export GOARCH=amd64 Test cases are working fine but the debugger stopped working of GoLand
I have tried two ways.
The text was updated successfully, but these errors were encountered: