英文: import cycle in golang with test packages 问题 我正在尝试重构一些测试代码,在两个包中我需要做相同的事情(连接到数据库)。我遇到了一个导入循环的问题。...
How do you structure imports for testing inside a module of your project?
英文: How do you structure imports for testing inside a module of your project? 问题 我正在尝试理解如何将一个Go项目结构化...
`go test -run NotExist` 为什么会通过?
英文: Why does `go test -run NotExist` pass? 问题 如果我运行以下命令: go test -run NotExist 响应是 PASS。鉴于我的测试文件中没有包...
Golang测试模拟函数的最佳实践
英文: Golang test mock functions best practices 问题 我正在为我的代码开发一些测试(使用testing包),我想知道在被测试的函数内部模拟函数的最佳方法是什...
在golang中使用datastore.GetAll没有得到结果。
英文: Not getting results with datastore.GetAll in golang 问题 我有两个函数:一个用于将实体写入数据存储,另一个用于检索它们。当我在检索中使用da...
扩展现有的 type testing.T 以添加额外的检查。
英文: Extending existing type testing.T for adding extra checks 问题 我意识到我可以将testing.T类型传递给需要处理测试接口的函数。但...
为失败的 XML/字符串测试自定义测试输出
英文: Custom testify output for failing test of xml / strings 问题 我正在测试使用testify进行XML编组,并使用strings.Cont...
Testing a REST API with GoConvey
英文: Testing a REST API with GoConvey 问题 我正在编写一个简单的服务,并想知道如何使用GoConvey测试REST API端点。理想情况下,我认为我需要启动服务器来...
Performance testing in Go – Where to start from?
英文: Performance testing in Go - Where to start from? 问题 我一直在学习Go语言,我只是一个新手。我刚刚完成了我的网站(仍然在本地主机上)。我想问一...
How can I test HTTPS endpoints in go?
英文: How can I test HTTPS endpoints in go? 问题 所以我正在尝试使用httptest.TLSServer来模拟对https请求的响应,但是发出请求的http.C...
60