2016-03-05 76 views
1

OS X优胜美地和所有补丁。安装去与Go 1.6不适用于OS X优胜美地

brew install go --cross-compile-common 

创建〜/工作中,建立环境是这样的:

export GOPATH=$HOME/work 
export GOROOT='/usr/local/Cellar/go/1.6' 
export PATH=$PATH:$GOROOT/bin 

现在尝试添加一个包装给我一个错误:

go get golang.org/x/tools/cmd/godoc 

package archive/zip: unrecognized import path "archive/zip" (import path does not begin with hostname) 
package bytes: unrecognized import path "bytes" (import path does not begin with hostname) 
package encoding/json: unrecognized import path "encoding/json" (import path does not begin with hostname) 
package encoding/xml: unrecognized import path "encoding/xml" (import path does not begin with hostname) 
package errors: unrecognized import path "errors" (import path does not begin with hostname) 
package expvar: unrecognized import path "expvar" (import path does not begin with hostname) 
package flag: unrecognized import path "flag" (import path does not begin with hostname) 
package fmt: unrecognized import path "fmt" (import path does not begin with hostname) 
... 

是否去支持OS X 10.10? 我在这里错过了什么?

+0

在这个问题上? – Artem

+0

取消您的GOROOT。 Homebrew会在安装过程中为你管理这个。 – elithrar

回答

6

尝试将您的GOROOT设置为/usr/local/Cellar/go/1.6/libexec。我记得我有同样的问题,这固定它。