GOPATH value setting

前端 未结 4 691
轮回少年
轮回少年 2021-02-04 08:18

I\'m install the go with the go1.3.1.windows-amd64.msi, after installation GOROOT is default setting, I found the D:\\Programs\\Go\\bin in the PATH,then I create a GOPATH envi

4条回答
  •  再見小時候
    2021-02-04 09:01

    I faced with the same problem. However i set everything as it was said in the tutorial but forgot to restart cmd. So the steps were:

    1. Download and install Go distribution(the GOROOT variable was set automatically)
    2. Create new folder wherever you like for your workspace, create there 3 directories: bin, src and pkg
    3. Then go to Control Panel -> All Control Panel Items -> System -> Advansed System Settings -> tab Advanced -> Environment Variables -> add new system variable by clicking New on System varaibles -> Variable name = GOPATH, Variable value = Your:\directory\that\you\created
    4. When you're done, RESTART your cmd or Bash(that's important) and you have your GOPATH set. To be sure run go env and you will see your value.

提交回复
热议问题