command line - GO: {GOOS} and {GOARCH} not recognised in environment -
i want change diretory go/pkg/darwin_amd64
$ cd $gopath/pkg/${goos}_${goarch}
doesn't find folder though directory exists.
$ echo $gopath/pkg/${goos}_${goarch}
gives /go/pkg/_
instead of /go/pkg/darwin_amd64
.
$ go env
prints:
goarch="amd64" gobin="" gochar="6" goexe="" gohostarch="amd64" gohostos="darwin" goos="darwin" gopath="/users/sahilkapoor/go" gorace="" goroot="/usr/local/go" gotooldir="/usr/local/go/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"
we can see goos
, goarch
defined here. using terminal on mac osx 10.10.3. missing?
$goos
, $goarch
defined in shell if have exported them (which, unless doing cross compilation, unlikely).
when run go env
, default values shown when have not been overwritten environment. should change command following desired results:
cd $(go env gopath)/pkg/$(go env goos)_$(go env goarch)
Comments
Post a Comment