I am trying to write an auto task to help me build go plugin. The task looks like this
{ "label": "compile wc.go", "type": "shell", "command": "go", "args": [ "build", "-buildmode=plugin", "-gcflags='all=-N -l'", "../mrapps/wc.go" ], "options": { "cwd": "${workspaceFolder}/src/main", } } When I ran it, terminal shows the following error:
> Executing task: go build -buildmode=plugin -gcflags='all=-N -l' ../mrapps/wc.go < /bin/bash: go: command not found The terminal process "/bin/bash '-c', 'go build -buildmode=plugin -gcflags='all=-N -l' ../mrapps/wc.go'" failed to launch (exit code: 127). The command go env works perfectly on integrated terminals when I ran it
(base) XIEs-MacBook-Pro:6.824 j$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" ...enter code here I've been searching for answers, but none.
I tried another task
{ "label": "test", "type": "shell", "command": "echo $PATH", "options": { "cwd": "${workspaceFolder}/src/main" } } which prints my PATH, which is clearly different from the one I got in bash or integrated terminals.
And I also tried open a python interpreter by task, which yields a python 2.7, definately not the default one (by which python).