03 2022 档案
摘要:同事写的一段代,码业务场景:需要多次GET请求一个三方服务的http 接口,获取数据后写入文件。发现有部分文件没有写入。查看日志出现了报错“socket: too many open files”、“too many open files”。 在此记录一下解决办法。这也是新写Go的人很常见的问题。
阅读全文
摘要:演示omitempty 代码: package main import ( "encoding/json" "fmt" ) func main() { type Hobby struct { Movie string `json:"movie,omitempty" bson:"movie"` Bas
阅读全文