2016-03-05 77 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。我記得我有同樣的問題,這固定它。