mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
v2 -> v3
This commit is contained in:
@ -12,13 +12,13 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/internal/reflection"
|
||||
"github.com/gogf/gf/v2/internal/rwmutex"
|
||||
"github.com/gogf/gf/v2/internal/utils"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/internal/reflection"
|
||||
"github.com/gogf/gf/v3/internal/rwmutex"
|
||||
"github.com/gogf/gf/v3/internal/utils"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
type ContentType string
|
||||
|
||||
@ -9,10 +9,10 @@ package gjson
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// Interface returns the json value.
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
package gjson
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gini"
|
||||
"github.com/gogf/gf/v2/encoding/gproperties"
|
||||
"github.com/gogf/gf/v2/encoding/gtoml"
|
||||
"github.com/gogf/gf/v2/encoding/gxml"
|
||||
"github.com/gogf/gf/v2/encoding/gyaml"
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v3/encoding/gini"
|
||||
"github.com/gogf/gf/v3/encoding/gproperties"
|
||||
"github.com/gogf/gf/v3/encoding/gtoml"
|
||||
"github.com/gogf/gf/v3/encoding/gxml"
|
||||
"github.com/gogf/gf/v3/encoding/gyaml"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
)
|
||||
|
||||
// ========================================================================
|
||||
|
||||
@ -9,9 +9,9 @@ package gjson
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/reflection"
|
||||
"github.com/gogf/gf/v2/internal/rwmutex"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/internal/reflection"
|
||||
"github.com/gogf/gf/v3/internal/rwmutex"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// New creates a Json object with any variable type of `data`, but `data` should be a map
|
||||
|
||||
@ -9,16 +9,16 @@ package gjson
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gini"
|
||||
"github.com/gogf/gf/v2/encoding/gproperties"
|
||||
"github.com/gogf/gf/v2/encoding/gtoml"
|
||||
"github.com/gogf/gf/v2/encoding/gxml"
|
||||
"github.com/gogf/gf/v2/encoding/gyaml"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/encoding/gini"
|
||||
"github.com/gogf/gf/v3/encoding/gproperties"
|
||||
"github.com/gogf/gf/v3/encoding/gtoml"
|
||||
"github.com/gogf/gf/v3/encoding/gxml"
|
||||
"github.com/gogf/gf/v3/encoding/gyaml"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// LoadWithOptions creates a Json object from given JSON format content and options.
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package gjson
|
||||
|
||||
import "github.com/gogf/gf/v2/os/gfile"
|
||||
import "github.com/gogf/gf/v3/os/gfile"
|
||||
|
||||
// Load loads content from specified file `path`, and creates a Json object from its content.
|
||||
// Deprecated: use LoadPath instead.
|
||||
|
||||
@ -9,9 +9,9 @@ package gjson
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// Valid checks whether `data` is a valid JSON data type.
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
json2 "encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -9,7 +9,7 @@ package gjson_test
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
)
|
||||
|
||||
func ExampleConversionNormalFormats() {
|
||||
|
||||
@ -9,7 +9,7 @@ package gjson_test
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
)
|
||||
|
||||
func ExampleJson_Set_DataSetCreate1() {
|
||||
|
||||
@ -9,8 +9,8 @@ package gjson_test
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func ExampleLoad() {
|
||||
|
||||
@ -9,7 +9,7 @@ package gjson_test
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
)
|
||||
|
||||
func ExampleNew() {
|
||||
|
||||
@ -9,7 +9,7 @@ package gjson_test
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
)
|
||||
|
||||
func ExampleDecodeToJson_PatternGet() {
|
||||
|
||||
@ -3,7 +3,7 @@ package gjson_test
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
)
|
||||
|
||||
func ExampleJson_SetSplitChar() {
|
||||
|
||||
@ -9,10 +9,10 @@ package gjson_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
func Test_ToJson(t *testing.T) {
|
||||
|
||||
@ -9,10 +9,10 @@ package gjson_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_Load_JSON1(t *testing.T) {
|
||||
|
||||
@ -9,8 +9,8 @@ package gjson_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_NewWithTag(t *testing.T) {
|
||||
|
||||
@ -10,11 +10,11 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/container/garray"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
func Test_Set1(t *testing.T) {
|
||||
|
||||
@ -9,8 +9,8 @@ package gjson_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_GetScan(t *testing.T) {
|
||||
|
||||
@ -9,11 +9,11 @@ package gjson_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
func TestJson_UnmarshalJSON(t *testing.T) {
|
||||
|
||||
@ -9,7 +9,7 @@ package gjson
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_checkDataType(t *testing.T) {
|
||||
|
||||
@ -10,13 +10,13 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
func Test_New(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user