golang
weixin_40455124
这个作者很懒,什么都没留下…
展开
-
golang pprof简单记录
pprof 可以获取go 程序的CPU HEAP使用信息 需要再代码启动时候引入"net/http/pprof" 默认cpu采集时间为30s,可以配置 http://localhost:9100/debug/pprof/profile?seconds=45 需要安装 yum install graphviz gv 可以直接指定对外提供访问端口 采集cpu 执行参考 go tool pprof -http=0.0.0.0:8080 http://localhost:9100/debug/pprof/pr原创 2020-09-24 21:25:12 · 261 阅读 · 0 评论 -
golang 替换string的0x00
记录下如何替换string 中的0x00,以下是实现 func OsIoutil(name string) string { if fileObj, err := os.Open(name); err == nil { //if fileObj,err := os.OpenFile(name,os.O_RDONLY,0644); err == nil { defer fileObj.Close() if contents, err := ioutil.ReadAll(fileObj); err原创 2020-08-19 19:12:33 · 1064 阅读 · 0 评论