golang
已收录文章:12811篇
-
问题内容 当前的 Go 库不提供队列容器。为了实现一个简单的队列,我使用圆形数组作为底层数据结构。它遵循TAOCP中提到的算法: Insert Y into queue X: X[R]<-Y; R<-(R+1)%M; if R=F then OVERFLOW. Dele270 收藏
-
问题内容 我正在用 Go 编写一个应用程序,它使用编码/gob 在节点之间通过 UDP 发送结构和切片。它工作正常,但我注意到 encoding/json 也有类似的 API。搜索并找到此信息(https://golang.org/pkg/enc177 收藏
-
问题内容 给定以下 Go 代码示例: package main import "fmt" type greeter interface { hello() goodbye() } type tourGuide struct { name string } func (t tourGuide) hello() { fmt.Println("Hello", t.nam365 收藏
-
问题内容 package main import ( "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request){ w.Write([]byte("hello world")) }) http.ListenAndServe(":800204 收藏
-
问题内容 在 Google Go 中,我读到字符串是不可变的,好吧,但它是 int 的吗?其他类型呢?作为一个年纪稍大的程序员,我更喜欢可变性,尽管我知道不变性的好处,但我更喜欢危险地生活208 收藏
-
问题内容 我已经习惯了 Go,并试图了解它是如何工作的。 所以我正在尝试从我的存储库 zoonoo/go-ethereum 运行测试代码,该存储库是从原始存储库ethereum/go-ethereum 分叉的。 当我go test .在eth目305 收藏