mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
improve gjson
This commit is contained in:
@ -160,7 +160,7 @@ func doLoadContent(dataType string, data []byte, unsafe ...bool) (*Json, error)
|
||||
case "json", ".json":
|
||||
|
||||
case "xml", ".xml":
|
||||
if result, err = gxml.Decode(data); err != nil {
|
||||
if data, err = gxml.ToJson(data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ func doLoadContent(dataType string, data []byte, unsafe ...bool) (*Json, error)
|
||||
}
|
||||
|
||||
case "toml", ".toml":
|
||||
if result, err = gtoml.Decode(data); err != nil {
|
||||
if data, err = gtoml.ToJson(data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@ -8,12 +8,13 @@ package gins_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/g/frame/gins"
|
||||
"github.com/gogf/gf/g/os/gfile"
|
||||
"github.com/gogf/gf/g/os/gtime"
|
||||
"github.com/gogf/gf/g/test/gtest"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Test_Config(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user