diff --git a/.example/os/gres/gres.go b/.example/os/gres/gres.go index 86ed3de9c..124627c5d 100644 --- a/.example/os/gres/gres.go +++ b/.example/os/gres/gres.go @@ -1,12 +1,14 @@ package main import ( - _ "github.com/gogf/gf/.example/os/gres/testdata" "github.com/gogf/gf/frame/g" "github.com/gogf/gf/os/gres" + _ "github.com/gogf/gf/os/gres/testdata" ) func main() { gres.Dump() g.Dump(gres.Scan("/root/image/", "*", true)) + g.Dump(gres.Scan("/template", "*")) + g.Dump(gres.Scan("/template/layout2", "*.html", true)) } diff --git a/os/gres/gres_file.go b/os/gres/gres_file.go index a7b33f22c..208641593 100644 --- a/os/gres/gres_file.go +++ b/os/gres/gres_file.go @@ -57,5 +57,6 @@ func (f *File) MarshalJSON() ([]byte, error) { "name": f.Name(), "size": info.Size(), "time": info.ModTime(), + "file": !info.IsDir(), }) }