mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:20:54 +00:00
add exist
This commit is contained in:
parent
3d47cd0a40
commit
d0e171c801
@ -196,12 +196,12 @@ func AddTemplateExt(ext string) {
|
||||
}
|
||||
|
||||
func BuildTemplate(dir string) error {
|
||||
f, err := os.Stat(dir)
|
||||
if err != nil {
|
||||
if _, err := os.Stat(dir); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return err
|
||||
} else {
|
||||
return errors.New("dir open err")
|
||||
}
|
||||
if !f.IsDir() {
|
||||
return errors.New("is not dir")
|
||||
}
|
||||
self := templatefile{
|
||||
root: dir,
|
||||
|
Loading…
Reference in New Issue
Block a user