diff --git a/frame/gins/gins_z_unit_view_test.go b/frame/gins/gins_z_unit_view_test.go index b5fdf46ae..0697583eb 100644 --- a/frame/gins/gins_z_unit_view_test.go +++ b/frame/gins/gins_z_unit_view_test.go @@ -13,6 +13,7 @@ import ( "github.com/gogf/gf/v2/os/gcfg" "github.com/gogf/gf/v2/os/gfile" + "github.com/gogf/gf/v2/os/gres" "github.com/gogf/gf/v2/os/gtime" "github.com/gogf/gf/v2/test/gtest" "github.com/gogf/gf/v2/util/gutil" @@ -59,8 +60,10 @@ func Test_View_Config(t *testing.T) { defer Config().GetAdapter().(*gcfg.AdapterFile).ClearContent() defer localInstances.Clear() + gres.Dump() gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetPaths()) gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetFileName()) + gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetContent()) gutil.Dump(Config().Data(ctx)) view := View("test1") diff --git a/os/gcfg/gcfg_adapter_file.go b/os/gcfg/gcfg_adapter_file.go index d98ac0fd8..49aacfbec 100644 --- a/os/gcfg/gcfg_adapter_file.go +++ b/os/gcfg/gcfg_adapter_file.go @@ -8,6 +8,7 @@ package gcfg import ( "context" + "fmt" "github.com/gogf/gf/v2/container/garray" "github.com/gogf/gf/v2/container/gmap" @@ -257,6 +258,7 @@ func (c *AdapterFile) getJson(fileName ...string) (configJson *gjson.Json, err e return nil } if file := gres.Get(filePath); file != nil { + fmt.Println("retrieve config content from gres:", filePath) content = string(file.Content()) } else { content = gfile.GetContents(filePath)