TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Moqueries – Lock-free interface and function mocks for Go

15 点作者 myshkin5超过 3 年前

1 comment

myshkin5超过 3 年前
Hi HN,<p>The primary goal (lock-free mocks for Go) is right there in the title but after converting lots of code, I&#x27;ve found the biggest payoff has been from generating more accurate code. Gomock&#x27;s recorder uses a lot of `interface{}` functions. Moqueries always uses the actual type from the interface or function type.<p>I&#x27;ve documented the internal structures used by the generated code here: <a href="https:&#x2F;&#x2F;github.com&#x2F;myshkin5&#x2F;moqueries&#x2F;tree&#x2F;main&#x2F;docs&#x2F;anatomy#anatomy-of-a-lock-free-mock" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;myshkin5&#x2F;moqueries&#x2F;tree&#x2F;main&#x2F;docs&#x2F;anatomy...</a><p>Let me know what you think.<p>Thanks! Dwayne