Should google-cloud-sdk be in /usr/local? Which directory should be added to GOPATH?

agolangf · · 406 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m having trouble setting up Go App engine. Should the google-cloud-sdk path be in GOROOT or GOPATH?</p> <p>I put the google-cloud-sdk in /usr/local</p> <p>It looks like there is source code in: goroot/</p> <pre><code>/usr/local/google-cloud-sdk/platform/google_appengine/goroot/ </code></pre> <p>go env </p> <pre><code>GOPATH=&#34;/usr/local/google-cloud-sdk/platform/google_appengine/goroot&#34; GORACE=&#34;&#34; GOROOT=&#34;/usr/local/go&#34; GOTOOLDIR=&#34;/usr/local/go/pkg/tool/darwin_amd64&#34; </code></pre> <p>$ go get</p> <pre><code>package google.golang.org/appengine: cannot download, /usr/local/google-cloud-sdk/platform/google_appengine/goroot is a GOROOT, not a GOPATH. For more details see: &#39;go help gopath&#39; package google.golang.org/appengine/datastore: cannot download, /usr/local/google-cloud-sdk/platform/google_appengine/goroot is a GOROOT, not a GOPATH. For more details see: &#39;go help gopath&#39; </code></pre> <p>I appended the path to google-cloud-sdk: </p> <pre><code>export GOROOT=&#34;/usr/local/go/:/usr/local/google-cloud-sdk/platform/google_appengine/goroot&#34; </code></pre> <p>GO doesn&#39;t seem to like multiple paths in GOROOT:<br/> $ go get </p> <pre><code>go: cannot find GOROOT directory: /usr/local/go/:/usr/local/google-cloud-sdk/platform/google_appengine/goroot </code></pre> <p>I did run the ./install.sh script after I copied the source to /usr/local</p> <p>The additional PATH&#39;s added did not fix the errors I was having.</p>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

406 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传