This commit is contained in:
John Guo
2025-04-10 14:12:35 +08:00
parent 1534abdb05
commit 2cc4835c49
1311 changed files with 4587 additions and 4587 deletions

View File

@ -13,8 +13,8 @@ import (
"os"
"strconv"
"github.com/gogf/gf/v2/encoding/ghash"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v3/encoding/ghash"
"github.com/gogf/gf/v3/errors/gerror"
)
// BinVersion returns the version of current running binary.

View File

@ -12,10 +12,10 @@ import (
func Test_getPackageFromCallerFunction(t *testing.T) {
dataMap := map[string]string{
"github.com/gogf/gf/v2/test/a": "github.com/gogf/gf/v2/test/a",
"github.com/gogf/gf/v2/test/a.C": "github.com/gogf/gf/v2/test/a",
"github.com/gogf/gf/v2/test/aa.C": "github.com/gogf/gf/v2/test/aa",
"github.com/gogf/gf/v2/test/gtest.C": "github.com/gogf/gf/v2/test/gtest",
"github.com/gogf/gf/v3/test/a": "github.com/gogf/gf/v3/test/a",
"github.com/gogf/gf/v3/test/a.C": "github.com/gogf/gf/v3/test/a",
"github.com/gogf/gf/v3/test/aa.C": "github.com/gogf/gf/v3/test/aa",
"github.com/gogf/gf/v3/test/gtest.C": "github.com/gogf/gf/v3/test/gtest",
}
for functionName, packageName := range dataMap {
if result := getPackageFromCallerFunction(functionName); result != packageName {

View File

@ -10,14 +10,14 @@ import (
"fmt"
"testing"
"github.com/gogf/gf/v2/debug/gdebug"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v3/debug/gdebug"
"github.com/gogf/gf/v3/test/gtest"
"github.com/gogf/gf/v3/text/gstr"
)
func Test_CallerPackage(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
t.Assert(gdebug.CallerPackage(), "github.com/gogf/gf/v2/test/gtest")
t.Assert(gdebug.CallerPackage(), "github.com/gogf/gf/v3/test/gtest")
})
}
@ -54,7 +54,7 @@ func Test_CallerFileLineShort(t *testing.T) {
func Test_FuncPath(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
t.Assert(gdebug.FuncPath(Test_FuncPath), "github.com/gogf/gf/v2/debug/gdebug_test.Test_FuncPath")
t.Assert(gdebug.FuncPath(Test_FuncPath), "github.com/gogf/gf/v3/debug/gdebug_test.Test_FuncPath")
})
}