- Add .golangci.yml with minimal linters (govet, ineffassign) - Run gofmt -s and goimports on all files to fix formatting - Disable fieldalignment and copylocks checks in govet
17 lines
388 B
Go
Executable File
17 lines
388 B
Go
Executable File
//go:build openbsd
|
|
// +build openbsd
|
|
|
|
package restore
|
|
|
|
import "syscall"
|
|
|
|
// getDiskSpace returns available disk space in bytes (OpenBSD)
|
|
func getDiskSpace(path string) (int64, error) {
|
|
var statfs syscall.Statfs_t
|
|
if err := syscall.Statfs(path, &statfs); err != nil {
|
|
return 0, err
|
|
}
|
|
// OpenBSD uses F_bavail and F_bsize
|
|
return int64(statfs.F_bavail) * int64(statfs.F_bsize), nil
|
|
}
|