version 2

This commit is contained in:
John Guo
2021-10-11 21:41:56 +08:00
parent bea54b445e
commit 1bc0635f8b
1053 changed files with 2892 additions and 2892 deletions

View File

@ -7,11 +7,11 @@
package gbase64_test
import (
"github.com/gogf/gf/debug/gdebug"
"github.com/gogf/gf/v2/debug/gdebug"
"testing"
"github.com/gogf/gf/encoding/gbase64"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gbase64"
"github.com/gogf/gf/v2/test/gtest"
)
type testPair struct {

View File

@ -9,8 +9,8 @@ package gbinary_test
import (
"testing"
"github.com/gogf/gf/encoding/gbinary"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gbinary"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_BeEncodeAndBeDecode(t *testing.T) {

View File

@ -9,8 +9,8 @@ package gbinary_test
import (
"testing"
"github.com/gogf/gf/encoding/gbinary"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gbinary"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_LeEncodeAndLeDecode(t *testing.T) {

View File

@ -10,8 +10,8 @@ import (
"math"
"testing"
"github.com/gogf/gf/encoding/gbinary"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gbinary"
"github.com/gogf/gf/v2/test/gtest"
)
type User struct {

View File

@ -21,8 +21,8 @@ package gcharset
import (
"bytes"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"io/ioutil"
"golang.org/x/text/encoding"

View File

@ -9,8 +9,8 @@ package gcharset_test
import (
"testing"
"github.com/gogf/gf/encoding/gcharset"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gcharset"
"github.com/gogf/gf/v2/test/gtest"
)
var testData = []struct {

View File

@ -9,7 +9,7 @@ package gcompress
import (
"bytes"
"compress/gzip"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/v2/os/gfile"
"io"
)

View File

@ -7,13 +7,13 @@
package gcompress_test
import (
"github.com/gogf/gf/debug/gdebug"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/debug/gdebug"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gtime"
"testing"
"github.com/gogf/gf/encoding/gcompress"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gcompress"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Gzip_UnGzip(t *testing.T) {

View File

@ -8,13 +8,13 @@ package gcompress_test
import (
"bytes"
"github.com/gogf/gf/debug/gdebug"
"github.com/gogf/gf/encoding/gcompress"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/v2/debug/gdebug"
"github.com/gogf/gf/v2/encoding/gcompress"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gtime"
"testing"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_ZipPath(t *testing.T) {

View File

@ -9,8 +9,8 @@ package gcompress_test
import (
"testing"
"github.com/gogf/gf/encoding/gcompress"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gcompress"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_Zlib_UnZlib(t *testing.T) {

View File

@ -10,9 +10,9 @@ import (
"archive/zip"
"bytes"
"context"
"github.com/gogf/gf/internal/intlog"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/text/gstr"
"io"
"os"
"path/filepath"

View File

@ -11,7 +11,7 @@ package ghash_test
import (
"testing"
"github.com/gogf/gf/encoding/ghash"
"github.com/gogf/gf/v2/encoding/ghash"
)
var (

View File

@ -3,8 +3,8 @@ package ghash_test
import (
"testing"
"github.com/gogf/gf/encoding/ghash"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/ghash"
"github.com/gogf/gf/v2/test/gtest"
)
var (

View File

@ -7,11 +7,11 @@
package ghtml_test
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"testing"
"github.com/gogf/gf/encoding/ghtml"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/ghtml"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_StripTags(t *testing.T) {

View File

@ -11,9 +11,9 @@ import (
"bufio"
"bytes"
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/json"
"io"
"strings"
)

View File

@ -7,9 +7,9 @@
package gini_test
import (
"github.com/gogf/gf/encoding/gini"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gini"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -8,14 +8,14 @@
package gjson
import (
"github.com/gogf/gf/internal/utils"
"github.com/gogf/gf/v2/internal/utils"
"reflect"
"strconv"
"strings"
"github.com/gogf/gf/internal/rwmutex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/internal/rwmutex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
const (

View File

@ -8,11 +8,11 @@ package gjson
import (
"fmt"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/util/gutil"
"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/container/gvar"
"github.com/gogf/gf/v2/container/gvar"
)
// Interface returns the json value.

View File

@ -7,11 +7,11 @@
package gjson
import (
"github.com/gogf/gf/encoding/gini"
"github.com/gogf/gf/encoding/gtoml"
"github.com/gogf/gf/encoding/gxml"
"github.com/gogf/gf/encoding/gyaml"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/v2/encoding/gini"
"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"
)
// ========================================================================

View File

@ -8,20 +8,20 @@ package gjson
import (
"bytes"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"reflect"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/encoding/gini"
"github.com/gogf/gf/encoding/gtoml"
"github.com/gogf/gf/encoding/gxml"
"github.com/gogf/gf/encoding/gyaml"
"github.com/gogf/gf/internal/rwmutex"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/encoding/gini"
"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/rwmutex"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/util/gconv"
)
// New creates a Json object with any variable type of <data>, but <data> should be a map

View File

@ -8,8 +8,8 @@ package gjson
import (
"bytes"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/util/gconv"
)
// Valid checks whether <data> is a valid JSON data type.

View File

@ -10,7 +10,7 @@ import (
json2 "encoding/json"
"testing"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
)
var (

View File

@ -8,7 +8,7 @@ package gjson_test
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
)
func Example_conversionNormalFormats() {

View File

@ -8,7 +8,7 @@ package gjson_test
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
)
func Example_dataSetCreate1() {

View File

@ -8,8 +8,8 @@ package gjson_test
import (
"fmt"
"github.com/gogf/gf/debug/gdebug"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/debug/gdebug"
"github.com/gogf/gf/v2/encoding/gjson"
)
func Example_loadJson() {

View File

@ -8,7 +8,7 @@ package gjson_test
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
)
func Example_newFromJson() {

View File

@ -8,7 +8,7 @@ package gjson_test
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
)
func Example_patternGet() {

View File

@ -7,12 +7,12 @@
package gjson_test
import (
"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/v2/container/gmap"
"testing"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_New(t *testing.T) {

View File

@ -7,13 +7,13 @@
package gjson_test
import (
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/util/gconv"
"testing"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/test/gtest"
)
func TestJson_UnmarshalJSON(t *testing.T) {

View File

@ -7,7 +7,7 @@
package gjson
import (
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -7,10 +7,10 @@
package gjson_test
import (
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/text/gstr"
"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"
"testing"
)

View File

@ -9,10 +9,10 @@ package gjson_test
import (
"testing"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gfile"
"github.com/gogf/gf/test/gtest"
"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"
)
func Test_Load_JSON1(t *testing.T) {

View File

@ -9,8 +9,8 @@ package gjson_test
import (
"testing"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/test/gtest"
)
func Test_NewWithTag(t *testing.T) {

View File

@ -8,12 +8,12 @@ package gjson_test
import (
"bytes"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v2/text/gstr"
"testing"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
)
func Test_Set1(t *testing.T) {

View File

@ -7,8 +7,8 @@
package gjson_test
import (
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -9,7 +9,7 @@ package gtoml
import (
"bytes"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/v2/internal/json"
"github.com/BurntSushi/toml"
)

View File

@ -6,9 +6,9 @@
package gtoml_test
import (
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/encoding/gtoml"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gtoml"
"github.com/gogf/gf/v2/test/gtest"
"testing"
)

View File

@ -9,8 +9,8 @@ import (
"net/url"
"testing"
"github.com/gogf/gf/encoding/gurl"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gurl"
"github.com/gogf/gf/v2/test/gtest"
)
var (

View File

@ -11,8 +11,8 @@ import (
"strings"
"github.com/clbanning/mxj/v2"
"github.com/gogf/gf/encoding/gcharset"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/v2/encoding/gcharset"
"github.com/gogf/gf/v2/text/gregex"
)
// Decode parses <content> into and returns as map.

View File

@ -8,13 +8,13 @@ package gxml_test
import (
"bytes"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/v2/encoding/gjson"
"strings"
"testing"
"github.com/gogf/gf/encoding/gcharset"
"github.com/gogf/gf/encoding/gxml"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gcharset"
"github.com/gogf/gf/v2/encoding/gxml"
"github.com/gogf/gf/v2/test/gtest"
)
var testData = []struct {

View File

@ -8,10 +8,10 @@
package gyaml
import (
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/v2/internal/json"
"gopkg.in/yaml.v2"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/util/gconv"
)
func Encode(v interface{}) ([]byte, error) {

View File

@ -7,14 +7,14 @@
package gyaml_test
import (
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/internal/json"
"testing"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/encoding/gyaml"
"github.com/gogf/gf/test/gtest"
"github.com/gogf/gf/v2/encoding/gyaml"
"github.com/gogf/gf/v2/test/gtest"
)
var yamlStr string = `