-
**My code:**
```
type sampleStruct struct {
ctx context.Context
}
func (ss *sampleStruct) Test(a int, b string) error {
fmt.Println("this is test")
// ....
return nil
}
…
-
Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output,
stacktraces, etc) as linked gists.
If this is about source listing…
-
例如
```golang
gomonkey.ApplyFunc(NewClient, func() *Client {
// 在这里会需要用到原始的 NewClient,但实际已经被替换掉了
return NewClient()
})
```
在 patch 前调用 NewClient 创建好实例也许可以解决这个问题,但是我的场景不太方便这么做,所以希望可以有…
-
```
func A() {
fmt.Println("real function")
}
```
```
func TestA(t *testing.T) {
gomonkey.ApplyFunc(A, func() {
fmt.Println("mock function")
})
A()
}
```
when run this test case…
-
Does gomonkey support generics for now?
```golang
func GeneraicMin[T int|int32](a, b T) T {
if a
-
my system is mac m1
when I used gomonkey, it reports:
# github.com/agiledragon/gomonkey
../../../../pkg/mod/github.com/agiledragon/gomonkey@v2.0.1+incompatible/patch.go:160:10: undefined: buildJmpD…
-
**Describe the bug**
Since macOS doesn't allow writing to text section of programs, trying to use `gomonkey` will panic.
**To Reproduce**
Steps to reproduce the behavior:
1. Clone the repo
2. R…
akojo updated
2 years ago
-
## What is the output when you execute the `go version` command?
$ go version
go version go1.20.6 windows/amd64
## What is the output when you execute the `go env` command?
go…
-
**What is your environment(Kubernetes version, Fluid version, etc.)**
**Describe the bug**
**What you expect to happen:**
**How to reproduce it**
**Additional Information**
-
version: v2.0.2+incompatible
work on: mac x86
```go
import (
"fmt"
"github.com/agiledragon/gomonkey"
"reflect"
"testing"
)
type A struct {
}
func (a *A) FuncA() string {
retur…