Skip to content

Instantly share code, notes, and snippets.

@mattmc3
Created April 6, 2017 00:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mattmc3/280892fd68f9d8630d9c0b08b8de6b37 to your computer and use it in GitHub Desktop.
Save mattmc3/280892fd68f9d8630d9c0b08b8de6b37 to your computer and use it in GitHub Desktop.
VSCode tasks 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": "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", "./..."]
}
]
}
@ycliu912
Copy link

ycliu912 commented Sep 6, 2019

tkx!

@hamza72x
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment