My desktop computer runs Linux and has an SSD and plenty of ram, so I’ve mounted /tmp to a tmpfs RAM disk, as others have suggested. This is nice because it makes things faster and cuts down on writes to the SSD, but it causes problems with some of the go tools.
go run and
gotour compile binaries to /tmp and try to run them from there. When /tmp is a tmpfs volume, you will get errors like this:
One solution is to set the tmp directory to a location that’s not in a ramdisk, just in the shell you’re using to run go. In a bash shell, you can do that with these commands:
Then the go commands will work correctly:
You will have to
export TMPDIR each time you open a new shell in which you want to use the problematic go tools.