Skip to content

Commit

Permalink
improve gjson
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Jul 16, 2019
1 parent 7fae21f commit 47d4230
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions g/encoding/gjson/gjson_api_new_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
5 changes: 3 additions & 2 deletions g/frame/gins/gins_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 47d4230

Please sign in to comment.