OS X Yosemite with all patches. Installed go with
brew install go --cross-compile-common
Created ~/work, setup environments like this:
export GOPATH=$HOME/work
export GOROOT='/usr/local/Cellar/go/1.6'
export PATH=$PATH:$GOROOT/bin
Now attempt to add a package gives me an error:
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)
...
Does Go support OS X 10.10? What did I miss here?
Try to set your GOROOT
to /usr/local/Cellar/go/1.6/libexec
. I remember I had the same problem and this fixed it.
You don't need to set the GOROOT
variable anymore http://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really
Does Go support OS X 10.10?
Yes, for Go up to 1.12.
Starting Q4 2019, not anymore. See Go 1.12 doc:
Darwin
Go 1.12 is the last release that will run on macOS 10.10 Yosemite.
Go 1.13 (Q4 2019) will require macOS 10.11 El Capitan or later.
libSystem
is now used when making syscalls on Darwin, ensuring forward-compatibility with future versions of macOS and iOS.
The switch tolibSystem
triggered additional App Store checks for private API usage.
Since it is considered private,syscall.Getdirentries
now always fails withENOSYS
on iOS.