英文: Why is time.sleep required to run certain goroutines? 问题 在GO教程中,我们有这个幻灯片:Goroutines package main...
Go语言全局变量避免被协程覆盖
英文: Go lang global variables without goroutines overwriting 问题 我正在用Go语言编写一个CMS,并且有一个会话类型(用户ID,要渲染的页面...
如何防止使用Go编写的HTTP服务器遭受DDoS攻击?
英文: How to prevent DDoS Attack from HTTP server written in Go? 问题 我正在使用Go开发一个HTTP服务器,但似乎无法防止DDoS攻击。我...
为什么Go语言的编译器“gc”使用与C语言不同的调用约定?
英文: Why does go's compiler "gc" use a different calling convention than C? 问题 C使用cdecl...
包测试的串行执行
英文: Serial execution of package tests 问题 我为一个Web API实现了几个包,每个包都有自己的测试用例。当使用go test ./api/pkgname测试每个...
适合解析geojson的结构类型
英文: Suitable struct type for unmarshal of geojson 问题 我想将一个geojson字符串解组成适当的结构类型。 我有三个不同的geojson字符串,我想...
多个goroutine监听一个通道
英文: Multiple goroutines listening on one channel 问题 我有多个goroutine同时尝试在同一个通道上接收。似乎最后一个开始在通道上接收的gorout...
如何关闭多个goroutine正在发送的通道?
英文: How do I close a channel multiple goroutines are sending on? 问题 我正在尝试并行计算。程序设计为每个工作协程将已解决的谜题的“片段...
在golang中使用json-rpc,将id作为字符串。
英文: json-rpc in golang, id as string 问题 我对Go语言还比较新。 我使用这个包https://github.com/kdar/httprpc来进行我的json-r...
如何将git版本添加到构建的二进制文件中?
英文: Go: how to add git revision to binaries built? 问题 我想将当前的git修订号添加到由go build构建的二进制文件中,这样我就可以像./myb...
2905