Skip to content

Instantly share code, notes, and snippets.

@hamza72x
Created May 21, 2021 03:00
Show Gist options
  • Save hamza72x/90d6749987a8124384dcfeb3d5a77c8c to your computer and use it in GitHub Desktop.
Save hamza72x/90d6749987a8124384dcfeb3d5a77c8c to your computer and use it in GitHub Desktop.
.vscode/tasks.json file for golang
// See http://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// ${workspaceRoot} the path of the folder opened in VS Code
// ${file} the current opened file
// ${fileBasename} the current opened file's basename
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "2.0.0",
"command": "go",
"type": "shell",
"reveal": "always",
"echoCommand": true,
"options": {
"cwd": "${workspaceRoot}",
"env": {
"GOPATH": "${workspaceRoot}/../.."
}
},
"tasks": [
{
"command": "go",
"type": "process",
"label": "go-run",
"args": [
"run",
"${workspaceRoot}/main.go"
],
"isBuildCommand": true
},
{
"command": "go",
"type": "process",
"label": "go-build",
"args": [
"build",
"-v",
"-o",
"exec"
]
},
{
"command": "go",
"type": "process",
"label": "go-test",
"args": [
"-v",
"./..."
],
"isTestCommand": true
},
{
"command": "go",
"type": "process",
"label": "go-integration_tests",
"suppressTaskName": true,
"args": [
"test",
"-v",
"./...",
"-tags=integration"
]
},
{
"command": "go",
"type": "process",
"label": "go-benchmark",
"suppressTaskName": true,
"args": [
"test",
"-bench=.",
"-v",
"./..."
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment