<p>I'm trying to install some software and get the following error:</p>
<pre><code>maruwan@ubuntu:~$ go get github.com/gorilla/rpc/v2/json2
package github.com/gorilla/rpc/v2/json2: cannot download, $GOPATH not set. For more details see: go help gopath
maruwan@ubuntu:~$ echo $GOPATH
/home/maruwan/go
maruwan@ubuntu:~$
</code></pre>
<p>Both my .profile and .bashrc contain these lines:</p>
<pre><code>GOPATH="$HOME/go" # contains bin, src & pkg
GOROOT="$HOME/Stuff/go" # contains go source
</code></pre>
<p>Can anyone help me debug this?</p>
<hr/>**评论:**<br/><br/>maruwan: <pre><p>I figured it out: I neded <code>export GOPATH=...</code></p>
<p>I added the <code>export</code> and now it works.</p></pre>jerf: <pre><p>Yes. In one of shell's many annoyances, there are local variables and exported variables, and virtually no indication which you have when you look.</p></pre>Femaref: <pre><p><code>env</code> access global, <code>set</code> shell variables.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传