greenhouse/diskutil/diskutil.go
func GetDiskUsage(path string) (percentBlocksFree float64, bytesFree, bytesUsed uint64, err error) {
	var stat syscall.Statfs_t
	err = syscall.Statfs(path, &stat)
	if err != nil {
		return 0, 0, 0, err
	}
	percentBlocksFree = float64(stat.Bfree) / float64(stat.Blocks) * 100
	bytesFree = stat.Bfree * uint64(stat.Bsize)
	bytesUsed = (stat.Blocks - stat.Bfree) * uint64(stat.Bsize)
	return percentBlocksFree, bytesFree, bytesUsed, nil
}
func GetDiskUsage(path string) (percentBlocksFree float64, bytesFree, bytesUsed uint64, err error) {
	var stat syscall.Statfs_t
	err = syscall.Statfs(path, &stat)
	if err != nil {
		return 0, 0, 0, err
	}
	percentBlocksFree = float64(stat.Bfree) / float64(stat.Blocks) * 100
	bytesFree = stat.Bfree * uint64(stat.Bsize)
	bytesUsed = (stat.Blocks - stat.Bfree) * uint64(stat.Bsize)
	return percentBlocksFree, bytesFree, bytesUsed, nil
}
func GetDiskUsage ( path string ) ( percentBlocksFree float64 , bytesFree , bytesUsed uint64 , err error ) { var stat syscall . Statfs_t err = syscall . Statfs ( path , & stat ) if err != nil { return 0 , 0 , 0 , err } percentBlocksFree = float64 ( stat . Bfree ) / float64 ( stat . Blocks ) * 100 bytesFree = stat . Bfree * uint64 ( stat . Bsize ) bytesUsed = ( stat . Blocks - stat . Bfree ) * uint64 ( stat . Bsize ) return percentBlocksFree , bytesFree , bytesUsed , nil }
// GetDiskUsage wraps syscall.Statfs for usage in GCing the disk
GetDiskUsage wraps syscall . Statfs for usage in GCing the disk