摘要: [golang] golang文件读写 os.OpenFile(fileName,os.O_APPEND|os.O_WRONLY,os.ModeAppend) 读写文件要用到的OS包 func OpenFile(name string, flag int, perm FileMode) (*File 阅读全文
posted @ 2020-06-16 11:48 landv 阅读(10014) 评论(3) 推荐(1) 编辑
摘要: [golang]log日志 Logrus的使用 Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger. Logrus is in mainte 阅读全文
posted @ 2020-06-16 11:10 landv 阅读(2446) 评论(0) 推荐(0) 编辑
摘要: Once 官方描述 Once is an object that will perform exactly one action,即 Once 是一个对象,它提供了保证某个动作只被执行一次功能,最典型的场景就是单例模式。 [Golang] 初探之 sync.Once sync.Once 是 Gola 阅读全文
posted @ 2020-06-16 10:26 landv 阅读(1108) 评论(0) 推荐(0) 编辑
摘要: [golang]golang signal.Notify 信号,如何优雅的退出 golang 中的signal 包的Notify函数 函数声明为 func Notify(c chan<- os.Signal, sig ...os.Signal) 官方描述: Notify函数让signal包将输入信号 阅读全文
posted @ 2020-06-16 09:05 landv 阅读(5296) 评论(0) 推荐(0) 编辑