Visual Studio CodeでGo言語(golang)のユニットテストをデバッグする
タイトルにあるように、Visual Studio CodeでGolangのユニットテストを実行してデバッグする方法についてです。
とは言っても、ほとんどデバッグ時の設定手順と同じですが・・・。
デバッグ時の設定手順
- メニューバーの「Debug」より「Open Configurations」か「Add Configurations」を選ぶ。
- launch.jsonが開く。
- 「mode」の値を「test」に変更して保存する。
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "go", "request": "launch", "mode": "test",
- F5を押し、デバッグを実行する。
以上です。