介绍Golang尝使用的库函数。
介绍
- bytes
- bufio,可以对 os.File、io.Reader 等进行操作
- crypto:加解密相关工具包,如 md5/sha1/sha256/sha512/hmac
- encoding:编解码,如 base64/json
- flag:命令行获取参数
- path
- log:日志模块
log.SetPrefix("gseo: ")
log.SetFlags(log.Flags | log.Llongfile) // 设置日志格式
log.Panicf("%s", "x") // panic 日志,之后退出
log.Fatalf("%s", "x") // fatal 日志,之后 os.Exit(1)
第三方库
- logrus Structured, pluggable logging for Go