英文: how to batch dealing with files using Goroutine? 问题 假设我有一堆要处理的文件(比如1000个或更多),首先它们应该通过函数A()进行处理,函...
What is the best way to save ssh output into a struct in golang?
英文: What is the best way to save ssh output into a struct in golang? 问题 我正在尝试将在其他机器上通过SSH运行的一些命令的输出保...
如何在其他路由中使用特定路由的中间件?
英文: How to use a middleware for a specific route, among other ones? 问题 我的简化路由与以下代码类似: r.Route("/...
如何从 Golang 的错误方法中返回结构体
英文: How to return struct from golang error method 问题 我正在使用Echo框架编写一个简单的REST API来处理路由。我试图使用中间件来实现集中式的...
使用反射动态获取结构体的所有字段的指针。
英文: Get pointers to all fields of a struct dynamically using reflection 问题 我正在尝试为Golang构建一个简单的ORM层。它...
无法运行’/usr/local/go/bin/go env’。配置更改可能未正确应用。
英文: Failed to run '/usr/local/go/bin/go env. The config change may not be applied correctly 问题 每...
MongoDB变更流在插入操作时返回空的fullDocument。
英文: MongoDB change stream returns empty fullDocument on insert 问题 Mongo 4.4和相应的Golang驱动程序被使用。数据库的副本集...
使用VSCode调试特定的Golang单元测试
英文: Debugging a specific golang unit test with VSCode 问题 我正在尝试在VSCode中使用断点调试特定的单元测试。 在命令行中,以下命令可以完美执...
在Go语言中设置二叉树的索引。
英文: Setting an index of a binary tree in go 问题 我正在尝试自学数据结构和算法,并且正在努力找出向二叉树添加索引的最佳方法。 我猜最好的方法是修改中序遍历操...
如何确保我最多一次只处理一条消息?
英文: How do I make sure that I process one message at a time at most? 问题 我想知道如何在Go中使用Google的pub/sub功能...
2905