I've been trying to set up my Go workspace, but it doesn't seem to be working. Whenever I type in
echo %GOPATH%, it echoes
C:Users\y\GoWorkspace. But whenever I type
go, it says
go is not recognized as an internal or external command. This is the same for any other Go command.
I am using Windows 8 64-bit with Go 1.2.2 32-bit. I have also tried Go 1.2.2 64-bit, but it didn't change anything.
C：Users \ y \ GoWorkspace </ code>。 但是，每当我键入
go </ code>时，都会说
go不被识别为内部或外部命令</ code>。 这与其他所有Go命令相同。</ p>
我正在使用Windows 8 64位和Go 1.2.2 32位。 我还尝试了64位Go 1.2.2，但没有任何改变。</ p>
GOPATH is the path that go uses when you build or test go applications. It does not tell Windows where your go executable is. For this you have to set you path environment variable. You can also set your GOBIN environment variable.
GOPATH是在构建或测试go应用程序时go使用的路径。 它不会告诉Windows go可执行文件在哪里。 为此，您必须设置路径环境变量。 您还可以设置GOBIN环境变量。</ p>
As @JohnGilmore has pointed out the GOPATH is the location the Go tools use (executables). To set the location to the go executable so that Windows can find the command you will need to set your PATH variable.
You can also set this so that it is in every new environment by typing 'env' into the Start->search and then choose 'Edit the system environment variables'.