title: Change GOCACHE default folder on Ubuntu Linux
body: <p>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.</p>
  
  <p>This <a href="https://stackoverflow.com/questions/48983303/how-to-change-cache-directory-during-the-go-build-process">SO thread</a> didn't help at all, not either <a href="https://groups.google.com/forum/#!topic/golang-dev/qfa3mHN4ZPA" rel="nofollow noreferrer">the article it links</a>. It doesn't seems to deal directly with that. How can I change it?</p>
  
  <p>Edit: the problem isn't how to find the GOCACHE, which I already know that can be viewed by <code>go env GOCACHE</code>, but <strong><em>how can I change that folder</em></strong>.</p>
  
  <p>I've tried to add to ~/ .bashrc:
  <code>export GOCACHE=$HOME/path/to/folder</code>, and now when I use <code>go env GOCACHE</code>, it points to the new folder but still tries to send files to <code>~/.cache/go-build</code>. The log file is now returning the following error:</p>
  
  <p><code>go: disabling cache (/home/&lt;me&gt;/.cache/go-build) due to initialization failure: mkdir /home/&lt;me&gt;/.cache/go-build: permission denied</code></p>