1
0
Fork 0
mirror of https://git.sr.ht/~yotam/shavit synced 2024-05-09 15:36:02 +02:00
shavit/fileutils.go
2020-03-14 12:59:10 +02:00

22 lines
298 B
Go

package main
import (
"mime"
"os"
"path/filepath"
)
func absPathMime(path string) string {
ext := filepath.Ext(path)
return mime.TypeByExtension(ext)
}
func isFile(path string) bool {
fileInfo, err := os.Stat(path)
if err != nil {
return false
}
return fileInfo.Mode().IsRegular()
}