mirror of
https://git.sr.ht/~yotam/shavit
synced 2024-05-09 15:36:02 +02:00
22 lines
298 B
Go
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()
|
|
}
|