英文: Adding a method for existing type in Golang: how to rewrite return value's type 问题 我想要扩展现有的g...
What type to use to correctly handle division of odd numbers of cents? (or smallest units of any currency)
英文: What type to use to correctly handle division of odd numbers of cents? (or smallest units of any...
Golang imap.DialTLS Config example
英文: Golang imap.DialTLS Config example 问题 我曾经可以像这样连接到邮件服务器的143端口: c, err := imap.Dial(mailServer) 上面...
转换类型以进行排序:是否有任何运行时成本?
英文: Converting types for sorting : any runtime cost? 问题 我刚刚开始学习Go语言(两天前开始,写了不到1000行代码),对一些习惯用法还有些疑惑。...
重置阅读器中的光标。
英文: Resetting cursor in Reader 问题 我正在编写一个程序来读取CSV文件。我遇到了一个奇怪的EOF错误,想知道是否有一种方法可以将*csv.Reader的行光标重置到文件...
给指针类型的结构属性添加方法
英文: Add method to Struct Property of pointer type 问题 我有这个结构体: type AppContext struct { DB *db.DB Pro...
处理GO中的大内存块
英文: Dealing with big memory chunks in GO 问题 有没有描述Go如何有效处理以下用例的指南: 应用程序接收到包含分隔名称的1亿个字符串,每个名称最长为1M。例如:...
router in Go – run a function before each http request
英文: router in Go - run a function before each http request 问题 你可以使用中间件(middleware)来在每个 HTTP 请求之前运行函数...
如何在Go中使用通道(channels)替代goroutines循环
英文: How to replace goroutines loop by channels in Go 问题 我有一个循环,每次迭代都有一个新的通道来源需要处理。好的,最好是展示我的代码。我有一个文...
在Go语言中,习惯性地过滤错误。
英文: Idiomatically filtering errors in Go 问题 在Go语言中,error类型非常广泛,实际包含的类型可能因平台和版本而异。通过检查错误的字符串值error.Er...
11727

