06 2020 档案
摘要:[golang]golang 语法糖'...'三个点的用法 ‘...’三个点是golang的一种语法糖,表示为可变参数,可以接受任意个数的参数。 示例一: package main import "fmt" func Greeting(prefix string, who ...string) {
阅读全文
摘要:[golang]golang EqualFold 字符串比较是否相等 EqualFold 源码 strings.EqualFold 是忽略大小写的比较,返回bool // EqualFold reports whether s and t, interpreted as UTF-8 strings,
阅读全文
摘要:[golang] golang文件读写 os.OpenFile(fileName,os.O_APPEND|os.O_WRONLY,os.ModeAppend) 读写文件要用到的OS包 func OpenFile(name string, flag int, perm FileMode) (*File
阅读全文
摘要:[golang]log日志 Logrus的使用 Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger. Logrus is in mainte
阅读全文
摘要:Once 官方描述 Once is an object that will perform exactly one action,即 Once 是一个对象,它提供了保证某个动作只被执行一次功能,最典型的场景就是单例模式。 [Golang] 初探之 sync.Once sync.Once 是 Gola
阅读全文
摘要:[golang]golang signal.Notify 信号,如何优雅的退出 golang 中的signal 包的Notify函数 函数声明为 func Notify(c chan<- os.Signal, sig ...os.Signal) 官方描述: Notify函数让signal包将输入信号
阅读全文
摘要:al_x:2.3862659E7##lVal:0##res:2.3862659E7##al_y:2.5144177E7 al_x:5.69426494550281E14##lVal:22646455##res:2.1607746E7##al_y:2.5144177E7 al_x:5.15618274
阅读全文