Files
got/httpdl/alloc_other.go
2026-06-19 12:32:14 +09:00

15 lines
308 B
Go

//go:build !linux
package httpdl
import "os"
// allocate is the portable fallback: fallocate is Linux-specific, so on other
// platforms prealloc/falloc degrade to a plain truncate.
func allocate(f *os.File, mode string, size int64) error {
if mode == "none" {
return nil
}
return f.Truncate(size)
}