2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-29 08:14:03 +00:00
restic/internal/fs/helpers.go
greatroar 1b20f6beec Remove io.Writer from fs.File
It was only used in a single test, which now uses plain *os.File instead.
2020-09-21 14:21:32 +02:00

14 lines
257 B
Go

package fs
import "os"
// IsRegularFile returns true if fi belongs to a normal file. If fi is nil,
// false is returned.
func IsRegularFile(fi os.FileInfo) bool {
if fi == nil {
return false
}
return fi.Mode()&(os.ModeType|os.ModeCharDevice) == 0
}