mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-15 19:12:40 +00:00
906639ad7e
* update viper version * removes our last uses of the slice package * fix tests
29 lines
405 B
Go
29 lines
405 B
Go
package locafero
|
|
|
|
import "io/fs"
|
|
|
|
// FileType represents the kind of entries [Finder] can return.
|
|
type FileType int
|
|
|
|
const (
|
|
FileTypeAll FileType = iota
|
|
FileTypeFile
|
|
FileTypeDir
|
|
)
|
|
|
|
func (ft FileType) matchFileInfo(info fs.FileInfo) bool {
|
|
switch ft {
|
|
case FileTypeAll:
|
|
return true
|
|
|
|
case FileTypeFile:
|
|
return !info.IsDir()
|
|
|
|
case FileTypeDir:
|
|
return info.IsDir()
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|