I must put all the files GO creates inside the structure of GO, not scattered. While changing GOPATH and GOROOT, I noticed the build folder on ~/.cache/go-build.
This SO thread didn't help at all, not either the article it links. It doesn't seems to deal directly with that. How can I change it?
Edit: the problem isn't how to find the GOCACHE, which I already know that can be viewed by go env GOCACHE
, but how can I change that folder.
I've tried to add to ~/ .bashrc:
export GOCACHE=$HOME/path/to/folder
, and now when I use go env GOCACHE
, it points to the new folder but still tries to send files to ~/.cache/go-build
. The log file is now returning the following error:
go: disabling cache (/home/<me>/.cache/go-build) due to initialization failure: mkdir /home/<me>/.cache/go-build: permission denied