0
打印 Go Test 的代码覆盖
source link: https://blog.lucien.ink/archives/520/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
打印 Go Test 的代码覆盖
请注意,本文编写于 228 天前,最后修改于 224 天前,其中某些信息可能已经过时。
打印 Go Test 的代码覆盖
将这段代码复制进 ~/.zshrc
或者是 ~/.bashrc
等文件中(取决于你的命令行),然后在任何一个 Go Package 中执行 cover
即可。
cover() {
t="/tmp/go-cover.$$.tmp"
go test -coverprofile=$t $@ && go tool cover -html=$t && unlink $t
}
最后修改:2021 年 07 月 29 日 05 : 36 PM
谢谢老板!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK