VSCode 运行go test显示打印日志

在VSCode中运行go test,在代码中写的html

fmt.Printf("TestB \n")

这些语句均不打印,只显示最终的结果git

PASS ok github.com/B 0.034s Success: Tests passed.

经查,须要在执行go test时添加-v参数,而默认不添加,须要在VSCode中添加相关设置github

文件>>首选项>>设置>>工做区设置>>在setting.json中编辑golang

在settings节点下添加 "go.testFlags": ["-v"], 保存便可。json

TestB PASS ok github.com/B 0.034s Success: Tests passed.

 

参考文档url

GO TESTspa

GOLANG显示输出日志.net

相关文章
相关标签/搜索