I just installed Golang on my Windows box today, and I have my %GOPATH%
set. However, when I run go install {...}
for various binaries, Windows can't find the executables. My %GOROOT%
is C:\Go
, the default .msi install location.
PS C:\Users\{user}\Development\go> ls
Directory: C:\Users\{user}\Development\go
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 12/11/2015 9:02 PM bin
d---- 12/11/2015 11:08 AM pkg
d---- 12/11/2015 11:08 AM src
C:\Users\{user}\Development\go>echo %GOPATH%
C:\Users\{user}\Development\go
Do I have the environmental variables set incorrectly?
Windows can't find the executables
If you mean the executable built from your go programs (by go install
) and delivered by Go in %GOPATH%\bin
, all you need is to add to your PATH
environment variable %GOPATH%\bin
(in addition of %GOROOT%\bin
)
set PATH=%PATH%;%GOPATH%\bin
cd %GOPATH%\src\path\to\a\go\project
go install
Then you can call your executable, and Windows will find it in %GOPATH%\bin
(the C:\Users\{user}\Development\go\bin
folder)