testing.T的使用
获取代码覆盖率
go test -coverprofile=c.out //将报告写进c.out
go tool cover -html=c.out //在html中打开
testing.B的使用
性能测试
go test -bench .
生成测试报告
go test -bench . -cpuprofile cpu.out
查看报告 //需要安装graphviz 使用ppro优化性能
go tool pprof cpu.out
(pprof) :输入web将会生成一张svg 图片