Comments (3)
gomonkey is not concurrent safe, try xgo if you need concurrent safety: https://github.com/xhd2015/xgo
from gomonkey.
gomonkey is not concurrent safe, try xgo if you need concurrent safety: https://github.com/xhd2015/xgo
Thank u, bro.
from gomonkey.
@kannae97
This has nothing to do with thread safety. When using sequence patches, ensure the sequence length is at least equal to the number of calls; otherwise, it will panic. Sequence patches emphasize that the return value differs with each call. In this case, the sequence patch length is 1, so using the sequence patch API is meaningless. Using the regular patch API is sufficient since the return value is the same for each call, with no call count limit.
from gomonkey.
Related Issues (20)
- Why ApplyFunc mocked func returns the same result in a for loop? HOT 1
- MacOS 上的 permission denied 问题,也可能和 cgo 有关 HOT 8
- why patches.Reset not effective? HOT 4
- panic with SIGBUS HOT 8
- MacOS ARM64 兼容性问题 HOT 7
- macos m2 兼容性问题 HOT 6
- 打桩的方法内仅执行 return 语句,打桩没有生效 HOT 2
- panic: runtime error: index out of range [0] with length 0 [darwin/arm64] [M1] HOT 8
- how to mock func which as a param in another func HOT 1
- mac os m1 ApplyFuncReturn not work and unit test many panic HOT 5
- i solve it successfully in mac M1 by update new gomonkey version for permission deny error HOT 3
- 内联优化导致apply func失效 HOT 3
- gomonkey 中有异步携程时,mock的方法会失效 HOT 7
- Private method tests fail on Linux/Arm64 HOT 6
- Is it possible to add a `init` func to check whether `-gcflags=all=-l` is in `os.Args`? HOT 2
- gomonky 为泛型结构体的方法打桩不生效 HOT 2
- Intellij IDEA中,如何对所有go test命令都设置`-gcflags=all=-l`参数? HOT 1
- 获取测试覆盖率失败 HOT 2
- Why no ApplyPrivateMethodFunc? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gomonkey.