Skip to content

Instantly share code, notes, and snippets.

@perj

perj/launch.json Secret

Created January 27, 2022 08:40
Show Gist options
  • Save perj/ec75ee651135ba0ba9aa64fc7eeb4033 to your computer and use it in GitHub Desktop.
Save perj/ec75ee651135ba0ba9aa64fc7eeb4033 to your computer and use it in GitHub Desktop.
Debugging magefile in VSCode
{
// 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": "Mage",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "mage_output_file.go",
// Pass magefile as a separate argument, VSCode doesn't allow more than one file in "program".
"buildFlags": "magefile.go",
"preLaunchTask": "create mage_output_file.go",
"postDebugTask": "delete mage_output_file.go"
}
]
}
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "create mage_output_file.go",
"type": "shell",
"command": "mage --keep"
},
{
"label": "delete mage_output_file.go",
"type": "shell",
"command": "rm -f mage_output_file.go"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment