initial commits

master
Charles Iliya Krempeaux 2024-01-23 06:13:32 -08:00
parent c54c73bc14
commit bb6ac970b4
1 changed files with 25 additions and 0 deletions

25
filesize.go 100644
View File

@ -0,0 +1,25 @@
package raft
import (
"io/fs"
)
// fileSize returns the file-size of an fs.File.
func fileSize(file fs.File) (int64, error) {
if nil == file {
return 0, errNilFile
}
var fileinfo fs.FileInfo
{
var err error
fileinfo, err = fileInfo(file)
if nil != err {
return 0, err
}
}
return fileinfo.Size(), nil
}