golang
已收录文章:14208篇
-
问题内容 我正在用 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 收藏
-
问题内容 我正在学习空接口。我发现虽然有很多解释——也包括 Stackoverflow——空接口的含义以及它们是如何工作的,但关于何时/为什么使用它们、何时避免、考虑什么的最佳实践的信息433 收藏