Go不是一个内部或外部命令。

huangapple go评论96阅读模式
英文:

Go is not an internal or external command

问题

我一直在尝试设置我的Go工作空间,但似乎没有成功。每当我输入echo %GOPATH%时,它会回显C:Users\y\GoWorkspace。但是每当我输入go时,它会显示go不是内部或外部命令。对于任何其他Go命令也是如此。

我使用的是Windows 8 64位,Go版本是1.2.2 32位。我也尝试过Go 1.2.2 64位,但没有改变任何东西。

英文:

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.

答案1

得分: 2

GOPATH是在构建或测试Go应用程序时Go使用的路径。它并不告诉Windows你的Go可执行文件的位置。为此,你需要设置你的路径环境变量。你也可以设置你的GOBIN环境变量。

英文:

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.

答案2

得分: 1

如@JohnGilmore所指出,GOPATH是Go工具使用的位置(可执行文件)。
要将位置设置为go可执行文件,以便Windows可以找到该命令,您需要设置PATH变量。

在Windows上:

SET %PATH%=%PATH%;C:\Go\bin

您还可以通过在开始菜单中键入'env',然后选择'编辑系统环境变量',将其设置为每个新环境中的变量。

英文:

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.

On Windows:

SET %PATH%=%PATH%;C:\Go\bin

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

huangapple
  • 本文由 发表于 2014年5月18日 21:26:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/23722405.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定