agiledragon / agiledragon/gomonkey

panic: permission denied; While adding export GOARCH=amd64 debugger is not working. Apple M1 Pro

Abierto
#112 2 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
2.3k
Forks
192
Merge medio
1 d 6 h
PR fusionados (30 d)
1

Descripción

Screen Shot 2022-10-04 at 12 16 26 PM

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.
1. Adding GOARCH=amd64 in the Environment Variable (RUN/DEBUG Configuration).
2. Add GOARCH=amd64 to the path variable in the zsh file.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.