1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 22:41:29 +00:00

add exist

This commit is contained in:
astaxie 2013-03-21 21:45:48 +08:00
parent 3d47cd0a40
commit d0e171c801

View File

@ -196,12 +196,12 @@ func AddTemplateExt(ext string) {
} }
func BuildTemplate(dir string) error { func BuildTemplate(dir string) error {
f, err := os.Stat(dir) if _, err := os.Stat(dir); err != nil {
if err != nil { if os.IsNotExist(err) {
return err return err
} } else {
if !f.IsDir() { return errors.New("dir open err")
return errors.New("is not dir") }
} }
self := templatefile{ self := templatefile{
root: dir, root: dir,