0

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).

0

2 Answers 2

1

You probably should set Run as login shell so all variables in the bash_profile(rc) will be exported. AFAIK here is the setting "terminal.integrated.shellArgs.osx": ["-l"] .

Sign up to request clarification or add additional context in comments.

Comments

0

Try to set terminal.integrated.shellArgs.osx as @Зелёный suggest, or you also can set up terminal.integrated.automationShell.osx to point to /bin/bash.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.