- Fixed type mismatch in disk space calculation (int64 casting) - Created platform-specific disk space implementations: * diskspace_unix.go (Linux, macOS, FreeBSD) * diskspace_windows.go (Windows) * diskspace_bsd.go (OpenBSD) * diskspace_netbsd.go (NetBSD fallback) - All 10 platforms now compile successfully: ✅ Linux (amd64, arm64, armv7) ✅ macOS (Intel, Apple Silicon) ✅ Windows (amd64, arm64) ✅ FreeBSD, OpenBSD, NetBSD
15 lines
362 B
Go
15 lines
362 B
Go
// +build !windows,!openbsd,!netbsd
|
|
|
|
package restore
|
|
|
|
import "syscall"
|
|
|
|
// getDiskSpace returns available disk space in bytes (Unix/Linux/macOS/FreeBSD)
|
|
func getDiskSpace(path string) (int64, error) {
|
|
var statfs syscall.Statfs_t
|
|
if err := syscall.Statfs(path, &statfs); err != nil {
|
|
return 0, err
|
|
}
|
|
return int64(statfs.Bavail) * int64(statfs.Bsize), nil
|
|
}
|