Debugging

Debugging in vscode is done by creating aΒ .vscode/launch.jsonΒ file in your repository.

{
  // 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": "clusters proxy",
      "type": "go",
      "request": "launch",
      "mode": "debug",
      "program": "cmd/tm",
      "args": ["cluster", "proxy"], //  parameters to pass to the program
      "console": "integratedTerminal" //  uses the terminal instead of the debug console, this allows the use of arrow keys
    }
  ]
}

Handy Keybinds

DescriptionKeybind
Go to last edit locationControl + K, Control + Q
Go to matching bracketControl + Shift + \
Go to definitionF12
Go to type definitionNot bound by default, check editor.action.goToTypeDefinition
Go to implementationCtrl + F12
SmartSelect growShift + Alt + β†’ (MacOS: ^ + ⌘ + βŒ₯ + β†’)
SmartSelect shrinkShift + Alt + ← (MacOS: ^ + ⌘ + βŒ₯ + ←)
Toggle between Explorer and EditorCtrl + Shift + E