os_std_alloc.go

 1//go:build !(linux || darwin) || sqlite3_flock
 2
 3package vfs
 4
 5import (
 6	"io"
 7	"os"
 8)
 9
10func osAllocate(file *os.File, size int64) error {
11	off, err := file.Seek(0, io.SeekEnd)
12	if err != nil {
13		return err
14	}
15	if size <= off {
16		return nil
17	}
18	return file.Truncate(size)
19}