From 028949f87ad6d613b62cf436d9e78105db4e0ffc Mon Sep 17 00:00:00 2001 From: Sandor Trombitas Date: Tue, 1 Oct 2024 09:25:54 +0300 Subject: [PATCH] docs(contributing): add section on setting up debugger --- CONTRIBUTING.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c83cb812fa..f00ca71012 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,6 +49,30 @@ Run the build binary like this. ./binary-releases/snyk-macos --version ``` +## Debugging the go binary with VSCode + +1. Build the cli using `make build-debug` + +2. Save the `Installing` path from the build output + +3. Open your `.vscode/launch.json` file and add the following under `configurations` + +```json +{ + "name": "Attach to Go Process", + "type": "go", + "request": "attach", + "mode": "local", + "remotePath": "" +} +``` + +4. Add your break points + +5. Run the cli from your build path, you will see a prompt to attach a Debugger + +6. Run "Attach to Go Process" from under your debug tab + ## Running tests You can run tests using standard Jest commands. See: [Jest CLI docs](https://jestjs.io/docs/cli).