英文: Multiple tags on the same Go struct member 问题 我觉得这应该是一个小问题,但是我尝试了我能想到的每种模式,但都没有成功。我有一个需要被encodin...
多个Go协程中传输数据的线程安全方式
英文: Thread-safe way to funnel data from multiple go routines 问题 给定以下示例:http://play.golang.org/p/owvJ...
Golang正则表达式替换没有任何效果
英文: Golang regex replace does nothing 问题 我想用破折号替换任何非字母数字字符序列。我写的一部分代码如下。然而它不起作用,我完全不知道为什么。有人能解释一下为什么...
使用inotifywait遇到了问题,尝试监视一个目录以便检测golang的变化。
英文: Having trouble with inotifywait, trying to watch a directory for golang changes 问题 我正在尝试编写一个bash...
Go中的配对/元组数据类型
英文: Pair/tuple data type in Go 问题 我需要一个(string, int)对的队列。这很容易: type job struct { url string depth in...
IO通道与读写器
英文: IO channels vs reader/writer 问题 由于Go语言具有通道(channels),我想知道为什么标准库似乎没有被设计成也使用通道进行IO操作。 相反,标准库中有读取器(...
当所有通道都关闭时,跳出select语句。
英文: breaking out of a select statement when all channels are closed 问题 我有两个独立产生数据的goroutine,每个都将数据发送...
向树中添加节点
英文: Adding nodes to a tree 问题 我正在使用Go编程语言开发一个项目,需要使用树结构并能够向树中添加节点(很多节点)。每个节点都是以下结构的结构体: type Node st...
从golang的缓冲读取器中读取特定数量的字节
英文: Reading specific number of bytes from a buffered reader in golang 问题 我知道bufio包中的特定函数。 func (b *R...
将[8]byte转换为uint64
英文: Convert [8]byte to a uint64 问题 我遇到了一个非常奇怪的问题。我有一个长度为8的[]byte,是通过一些十六进制解码得到的。我需要将它转换为uint64以便使用。我...
2905