mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
ci test
This commit is contained in:
parent
4bdaacab91
commit
f6f0c8fd1e
@ -13,6 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gogf/gf/v2/os/gcfg"
|
"github.com/gogf/gf/v2/os/gcfg"
|
||||||
"github.com/gogf/gf/v2/os/gfile"
|
"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/os/gtime"
|
||||||
"github.com/gogf/gf/v2/test/gtest"
|
"github.com/gogf/gf/v2/test/gtest"
|
||||||
"github.com/gogf/gf/v2/util/gutil"
|
"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 Config().GetAdapter().(*gcfg.AdapterFile).ClearContent()
|
||||||
defer localInstances.Clear()
|
defer localInstances.Clear()
|
||||||
|
|
||||||
|
gres.Dump()
|
||||||
gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetPaths())
|
gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetPaths())
|
||||||
gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetFileName())
|
gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetFileName())
|
||||||
|
gutil.Dump(Config().GetAdapter().(*gcfg.AdapterFile).GetContent())
|
||||||
gutil.Dump(Config().Data(ctx))
|
gutil.Dump(Config().Data(ctx))
|
||||||
|
|
||||||
view := View("test1")
|
view := View("test1")
|
||||||
|
@ -8,6 +8,7 @@ package gcfg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/gogf/gf/v2/container/garray"
|
"github.com/gogf/gf/v2/container/garray"
|
||||||
"github.com/gogf/gf/v2/container/gmap"
|
"github.com/gogf/gf/v2/container/gmap"
|
||||||
@ -257,6 +258,7 @@ func (c *AdapterFile) getJson(fileName ...string) (configJson *gjson.Json, err e
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if file := gres.Get(filePath); file != nil {
|
if file := gres.Get(filePath); file != nil {
|
||||||
|
fmt.Println("retrieve config content from gres:", filePath)
|
||||||
content = string(file.Content())
|
content = string(file.Content())
|
||||||
} else {
|
} else {
|
||||||
content = gfile.GetContents(filePath)
|
content = gfile.GetContents(filePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user