mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:51:29 +00:00
add exist
This commit is contained in:
parent
3d47cd0a40
commit
d0e171c801
12
template.go
12
template.go
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user