title: How to create RAM disk with Golang and in a platform-independent way?
body: <p>RAM disk can be created in command line with different commands on different operating systems.<br>
  For example, to create a RAM disk of 512MB ---</p>
  
  <p>On macOS:</p>
  
  <pre><code>diskutil eraseVolume HFS+ "RAMDisk" `hdiutil attach -nomount ram://1048576`
  </code></pre>
  
  <p>On Ubuntu:</p>
  
  <pre><code>mkdir /mnt/ramdisk
  mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk
  </code></pre>
  
  <p>Is there any cross-platform method/way to create a RAM disk in Golang?</p>