Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

go: command not found #1017

Closed
RobGraham opened this issue Jun 1, 2017 · 3 comments
Closed

go: command not found #1017

RobGraham opened this issue Jun 1, 2017 · 3 comments

Comments

@RobGraham
Copy link

RobGraham commented Jun 1, 2017

I've been going a little crazy trying to get the go command working in vscode. I may have installed Golang on the system after i tried installing the Go package however the terminal in vscode doesn't recognize the go command while the main Terminal app does.
I have uninstalled and reinstalled the Go package from VS Code 4-5x times including closing and creating new terminal sessions inside the program. Why is the main Terminal app able to access go while the terminal inside vs code isn't?

OS: OSX
VS Code: v 1.12.2
GoLang: 1.8.3
Go env:

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/q530/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gc/_qqxbk491f17hchg5fjmjqynxj_yzn/T/go-build014270738=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 2, 2017

Can you start VS Code from the main terminal where the go command works using the command code and then see if you can use the go command in the integrated terminal?

Running the go command in the integrated terminal has nothing to do with the Go extension.

It is more likely that the integrated terminal doesn't have the same PATH as your external terminal and is not able to find go

See #708 (comment) as well

@RobGraham
Copy link
Author

After looking around and echo'ing my $PATH I noticed that go was installed in /usr/local/go/bin while my exported PATH referring to /usr/local/binand some other matches. I just added the exact path to my .bash_profile and everything is working now. Thanks for the feedback.

@ramya-rao-a
Copy link
Contributor

Glad that you are unblocked now, Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants