mirror of
https://github.com/foomo/gofoomo.git
synced 2025-10-16 12:25:44 +00:00
19 lines
284 B
Go
19 lines
284 B
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
)
|
|
|
|
// IsDir tells you is it a dir or not
|
|
func IsDir(filename string) (isDir bool, err error) {
|
|
i, err := os.Stat(filename)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
if !i.IsDir() {
|
|
return false, errors.New("not a dir")
|
|
}
|
|
return true, nil
|
|
}
|