Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
VSCode tasks for Golang
// See
// 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": "0.1.0",
"command": "go",
"isShellCommand": true,
"showOutput": "always",
"echoCommand": true,
"options": {
"cwd": "${workspaceRoot}",
"env": {
"GOPATH": "${workspaceRoot}/../.."
"tasks": [
"taskName": "run",
"args": ["${workspaceRoot}/main.go"],
"isBuildCommand": true
"taskName": "build",
"args": ["-v", "./..."]
"taskName": "test",
"args": ["-v", "./..."],
"isTestCommand": true
"taskName": "integration_tests",
"suppressTaskName": true,
"args": ["test", "-v", "./...", "-tags=integration"]
"taskName": "benchmark",
"suppressTaskName": true,
"args": ["test", "-bench=.", "-v", "./..."]

This comment has been minimized.

Copy link

ycliu912 commented Sep 6, 2019


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.