-
大佬,我在给新人安利使用gomonkey进行单元测试的时候,我让他们到test文件夹下的官方范例中进行学习。
但是新人反应,gomonkey的官方教程中使用到了convey,但是他们并不了解convey,convey包给他们阅读代码带来了较大的不便性,也不太愿意再花费时间再去花时间学习convey,甚至有些新人误以为convey和gomonkey是耦合的。
大佬您看能不能把test包下的测试范…
-
Build error with development branch.
## This is: Bug
- Bug
Log:
330-15ikb:~/webiny-js$ git status
On branch development
Your branch is up to date with 'origin/development'.
nothing to commi…
-
您好,在业务中需要对http请求进行mock,所以对http.Client的Do方法进行打桩,但是用如下的代码打桩之后,发现在实际的使用中并没有生效。想请大神帮忙看看为什么
```golang
// http请求打桩
var c *http.Client
patches := gomonkey.ApplyMethod(reflect.TypeOf(c), "Do",func(c *…
-
```
type Config interface {
Load() error
Reload()
Get(string, interface{}) interface{}
Unmarshal(interface{}) error
IsSet(string) bool
GetInt(str…
-
Here is the error log.
```
$ make test
Running tests...
Test project /Users/tobe/code/subhook/buid
Start 1: subhook_test_exe_test
1/2 Test #1: subhook_test_exe_test ............***Failed …
-
gomonkey 是否被多协程并发用于同一个目标的打桩?如果是,则需要将之前的协程先优雅退出;
我A函数goroutine并发调用B函数,B函数中的调用proto.Unmarshal,发现对proto.Unmarshal ApplyFucn 为生效
-
go 1.11.4能跑通的单元测试代码,在go1.14中跑不通
-
有个函数需要调用 [oliver](https://github.com/olivere/elastic) 库创建 elasticsearch client,使用下面方法
```
patches := gomonkey.ApplyFunc(elastic.NewClient,
func(options ...elastic.ClientOptionFunc) (*elastic.Cli…
-
error permission denied occured when run gomock
stack like this:
panic(0x481a500, 0xc00023e208)
/usr/local/Cellar/go/1.12.9/libexec/src/runtime/panic.go:522 +0x1b5
github.com/agiledragon/…
-
When I used gomonkey write test case in win10 platform, mocked os.RemoveAll() and it worked, but in Ubuntu14.04 and Ubuntu16.04, not worked. Please take a look at this case, see if it is a bug.
bel…