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.

 

參考文檔spa

GO TEST.net

GOLANG顯示輸出日誌日誌

相關文章
相關標籤/搜索