打赏
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 54 下一页
摘要: Gorm 建立了对 Logger 的支持,默认模式只会在错误发生的时候打印日志。可以通过gorm SetLogger(log logger)方法 改变gorm 打日志的行为。 gorm 中 logger的接口: type logger interface { Print(ctx context.Co 阅读全文
posted @ 2020-07-03 14:14 苍山落暮 阅读(8651) 评论(0) 推荐(0)
摘要: SQL清空全部表数据 先执行select语句生成所有truncate语句 语句格式: select CONCAT('truncate TABLE ',table_schema,'.',TABLE_NAME, ';') from INFORMATION_SCHEMA.TABLES where tabl 阅读全文
posted @ 2020-07-03 09:24 苍山落暮 阅读(2358) 评论(0) 推荐(0)
摘要: (1.)免费证书申请 //阿里云证书 https://juejin.im/post/5d00f8706fb9a07ede0b3c90 https://common-buy.aliyun.com/?spm=5176.2020520163.cas.3.4bf91BFD1BFDcm&commodityCo 阅读全文
posted @ 2020-07-03 09:22 苍山落暮 阅读(311) 评论(0) 推荐(0)
摘要: Nginx ingress 跨域: nginx.ingress.kubernetes.io/cors-allow-headers: >- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache 阅读全文
posted @ 2020-07-03 09:18 苍山落暮 阅读(3279) 评论(0) 推荐(0)
摘要: SQL优化工具 (1.)小米公司的soar,下载二进制文件 https://github.com/XiaoMi/soar/releases (2.)使用说明: https://www.jianshu.com/p/1594228e18c6 (3.)安装Web图形化工具,下载地址: https://gi 阅读全文
posted @ 2020-07-02 08:47 苍山落暮 阅读(525) 评论(0) 推荐(0)
摘要: (1.)单元测试性能测试 https://github.com/guyan0319/golang_development_notes/blob/master/zh/1.9.md (2.)gotests使用 https://github.com/cweill/gotests (3.)Goland插件 阅读全文
posted @ 2020-07-02 08:45 苍山落暮 阅读(155) 评论(0) 推荐(0)
摘要: golang pprof使用 (1.)采用http的方式来采集pprof的性能分析数据。 // pprof 的init函数会将pprof里的一些handler注册到http.DefaultServeMux上 // 当不使用http.DefaultServeMux来提供http api时,可以查阅其i 阅读全文
posted @ 2020-07-01 11:31 苍山落暮 阅读(755) 评论(0) 推荐(0)
摘要: 前言 提到Go语言的并发,就不得不提goroutine,其作为Go语言的一大特色,在日常开发中使用很多。 在日常应用场景就会涉及一个goroutine启动或结束,启动一个goroutine很简单只需要在函数前面加关键词go即可,而由于每个goroutine都是独立运行的,其退出有自身决定的,除非ma 阅读全文
posted @ 2020-06-30 18:24 苍山落暮 阅读(565) 评论(0) 推荐(0)
摘要: 1.chattr和lsattr使用 lsattr /etc/resolv.conf chattr +i /etc/resolv.conf #不能修改,不能删除 只读 lsattr /etc/resolv.conf #查看文件属性 chattr -i +a /etc/resolv.conf #只能追加 阅读全文
posted @ 2020-06-30 14:07 苍山落暮 阅读(161) 评论(0) 推荐(0)
摘要: 1.安装mariadb数据库 apt install mariadb-server systemctl restart mariadb.service systemctl enable mariadb.service 2.进入mysql MariaDB [(none)]> show database 阅读全文
posted @ 2020-06-30 08:47 苍山落暮 阅读(253) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 54 下一页