上一页 1 ··· 5 6 7 8 9
摘要: 安装ssh opkg update # openssh-keygen 可以用来生产密钥 opkg install openssh-keygen # 连接其他服务器 opkg install openssh-client # 生成密钥,可以指定文件名,注意算法,gitee有不支持SHA1算法。git 阅读全文
posted @ 2022-05-04 21:19 熊先生不开玩笑 阅读(567) 评论(0) 推荐(0)
摘要: 转载自:https://www.ohyee.cc/post/note_go_read_openwrt_timezone openwrt 运行golang 时候发现打印时间错误。golang读取时区的过程: 读取TZ环境变量 读取/etc/localtime文件 本地时区读取失败,使用 UTC 时间 阅读全文
posted @ 2022-05-02 22:48 熊先生不开玩笑 阅读(794) 评论(0) 推荐(0)
摘要: gin 使用gorilla 时建立websocket的教程很多博客都有写,但是很少有人讲关闭websocket时自定义 close code 和message。主要是使用:websocket.FormatCloseMessage, WriteControl 两个方法 。可用close code 的范 阅读全文
posted @ 2022-04-15 19:53 熊先生不开玩笑 阅读(1014) 评论(0) 推荐(0)
摘要: 同事写的一段代,码业务场景:需要多次GET请求一个三方服务的http 接口,获取数据后写入文件。发现有部分文件没有写入。查看日志出现了报错“socket: too many open files”、“too many open files”。 在此记录一下解决办法。这也是新写Go的人很常见的问题。 阅读全文
posted @ 2022-03-21 19:39 熊先生不开玩笑 阅读(1778) 评论(0) 推荐(0)
摘要: 演示omitempty 代码: package main import ( "encoding/json" "fmt" ) func main() { type Hobby struct { Movie string `json:"movie,omitempty" bson:"movie"` Bas 阅读全文
posted @ 2022-03-10 15:15 熊先生不开玩笑 阅读(1941) 评论(1) 推荐(0)
上一页 1 ··· 5 6 7 8 9