dongsheng6056 2015-01-31 16:22
浏览 2
已采纳

无法在OSX Yosemite上设置Go环境

I've installed Go on OSX using Homebrew so that I could install alpaca, but keep getting errors like this:

package github.com/GeertJohan/go.rice/rice
    imports github.com/GeertJohan/go.incremental
    imports github.com/GeertJohan/go.rice/embedded
    imports github.com/akavel/rsrc/binutil
    imports github.com/akavel/rsrc/coff
    imports github.com/daaku/go.zipexe
    imports github.com/jessevdk/go-flags
    imports github.com/robertkrimen/terst
    imports testing: unrecognized import path "testing"
package github.com/GeertJohan/go.rice/rice
    imports github.com/GeertJohan/go.incremental
    imports github.com/GeertJohan/go.rice/embedded
    imports github.com/akavel/rsrc/binutil
    imports github.com/akavel/rsrc/coff
    imports github.com/daaku/go.zipexe
    imports github.com/jessevdk/go-flags
    imports github.com/robertkrimen/terst
    imports bitbucket.org/kardianos/osext
    imports bitbucket.org/pkg/inflect
    imports unicode: unrecognized import path "unicode"
make: *** [deps] Error 1

Googling around it seems the issue is with my go environment, but I can't seem to figure out how to resolve this. Here's what I see when I run go env:

GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mc/go"
GORACE=""
GOROOT="/Users/mc/go/packages"
GOTOOLDIR="/Users/mc/go/packages/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What am I getting wrong here?

  • 写回答

2条回答 默认 最新

  • dongxun6458 2015-02-01 15:32
    关注

    GOROOT="/Users/mc/go/packages" is incorrect.

    You should not have to set your GOROOT. checkout out this blog post by Dave Cheney.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn