golang
已收录文章:14425篇
-
问题内容 我最近在玩 go 并尝试创建一些服务器来响应 tcp 连接上的客户端。 我的问题是我如何干净地关闭服务器并中断当前在以下调用中“阻塞”的 go-routine func (*TCPListener) 接受? 根据Ac400 收藏
-
问题内容 type T struct { Id int Name string } func Copy(a *T, b *T) error { b.Id=5 b.Name="gert" a = b return nil } a仍然是空的,我必须这样做 func Copy(a *T, b *T) error { b.Id = 5 b.Name =400 收藏
-
问题内容 How do I convert the below code to use streams/pipes so that I don't need to read the full content into memory? Something like: http.Get("http://example.com/").Pipe("./data.txt") package main import ("net/http&q400 收藏
-
问题内容 有人可以向我展示一个工作示例,说明如何myPassword := "beautiful"使用 Go 1 生成我拥有的字符串的 SHA 哈希值吗? 文档页面缺少示例,我在 Google 上找不到任何工作代码。400 收藏
-
问题内容 Golang是否可以在不同结构类型之间进行转换? 正确答案 可以在不同结构类型之间进行转换。在 Golang 中,可以通过显式转换或使用类型断言实现结构类型之间的转换。 显式400 收藏
-
问题内容GOROOT=/usr/local/Cellar/go/1.15.4/libexec #gosetup GOPATH=/Users/liaozhuodi/go #gosetup /usr/local/Cellar/go/1.15.4/libexec/bin/go build -o /private/var/folders/pj/q4f22qf92fgclfjc1s1f7rnm0000gn/T/GoLand/___go_build_21_12_06_slice_go -gcflags400 收藏