title: Get amount of free disk space using Go
body: <p>Basically I want the output of <code>df -h</code>, which includes both the free space and the total size of the volume.  The solution needs to work on Windows, Linux, and Mac and be written in Go. </p>
  
  <p>I have looked through the <code>os</code> and <code>syscall</code> Go documentation and haven't found anything.  On Windows, even command line utils are either awkward (<code>dir C:\</code>) or need elevated privileges (<code>fsutil volume diskfree C:\</code>). Surely there is a way to do this that I haven't found yet...</p>
  
  <p>UPDATE:<br>
  Per nemo's answer and invitation, I have provided a <a href="https://github.com/ricochet2200/go-disk-usage">cross-platform Go package</a> that does this.</p>