I have a strange issue:
go install
works fine.
However CGO_ENABLED=0
gives me an error:
➜ CGO_ENABLED=0 go install
go install net: open /usr/local/go/pkg/linux_amd64/net.a: permission denied
I don't get why it thinks that net package changed.
I was trying to resolve it by doing
➜ go clean -i
and by
➜ rm -r $GOPATH/pkg
which didn't help. Here is my setup:
➜ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/aberezhynskyi/work/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build254491808=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
➜ go version
go version go1.7.1 linux/amd64