From e58384d81572533514970b90a011f2d3070aae65 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 16 Aug 2019 00:37:12 +0800 Subject: [PATCH] update example for gres --- .example/os/gres/gres.go | 4 +++- os/gres/gres_file.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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(), }) }