d0e171c8 by astaxie

add exist

1 parent 3d47cd0a
...@@ -196,12 +196,12 @@ func AddTemplateExt(ext string) { ...@@ -196,12 +196,12 @@ func AddTemplateExt(ext string) {
196 } 196 }
197 197
198 func BuildTemplate(dir string) error { 198 func BuildTemplate(dir string) error {
199 f, err := os.Stat(dir) 199 if _, err := os.Stat(dir); err != nil {
200 if err != nil { 200 if os.IsNotExist(err) {
201 return err 201 return err
202 } else {
203 return errors.New("dir open err")
202 } 204 }
203 if !f.IsDir() {
204 return errors.New("is not dir")
205 } 205 }
206 self := templatefile{ 206 self := templatefile{
207 root: dir, 207 root: dir,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!