Go Test

...

测试指定函数

例如: 仅执行单元测试 TestAdd()

go test -v -run TestAdd ./

执行所有 TestClient 开头的单元测试

go test -v 

示例

可以在测试中添加示例来演示真实的使用情况, 来保证测试和演示的真实性和有效性.

some command

go test -test.v -test.run ^\Q<Test_Func>\E$ -test.coverprofile testcover.out

go tool test2json -t

go tool cover -html

参考

posted @ 2019-06-19 14:55  taadis  阅读(168)  评论(0编辑  收藏  举报