Local golang playground
October 31st, 2024
Creates a local go playground in VSCode with ⇧⌘B
to run. Just add this to .vscode/tasks.json
. Alternatively, you can add it to a profile, which I prefer since I can set a separate color to indicate the “environment” I’m in.
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Go file",
"type": "shell",
"command": "clear; go run ${file}",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
]
}
I wanted to replicate the ⌘⏎
, but key bindings in VSCode can only be set at the global or user level, not the workspace or profile. There are some workarounds, but they all seem more complicated than getting used to the build shortcut.