Error “cannot download, $GOPATH not set.”

后端 未结 6 1384
南旧
南旧 2021-02-02 08:41

Setup:

Have a look at my configuration:

$ echo $GOPATH && ls -r $GOPATH
/home/cyrus/.go
src  pkg  bin

$ echo $GOROOT &&         


        
6条回答
  •  既然无缘
    2021-02-02 09:08

    If you set a variable like this:

    GOPATH=$HOME/go
    

    It won't be exported to any subprocesses. It's only available to that process. If you want to export it to subprocesses, use export:

    export GOPATH
    

    You can also combine the assignment and export:

    export GOPATH=$HOME/go
    

提交回复
热议问题