Saturday, March 26, 2016

create a temporary file storage

The go build tool uses /tmp when compiling and testing, this can cause heavy wear and tear if /tmp lives on your SD card. To minimise this effect, either export TMPDIR to somewhere that lives on another filesystem. Alternatively if you have lots of physical memory you can mount a swap backed tmpfs filesystem on /tmp by adding this line to /etc/fstab

# tmpfs /tmp tmpfs nodev,nosuid,mode=1777 0 0

Reference:

https://github.com/golang/go/wiki/GoArm

No comments: