refract(container/gtype): rename package gtype to gatomic (#4274)

This commit is contained in:
John Guo
2025-05-07 19:11:44 +08:00
committed by GitHub
parent f52b7de1cf
commit 1f2fcd39b1
69 changed files with 312 additions and 312 deletions

View File

@ -12,7 +12,7 @@ import (
"testing"
"time"
"github.com/gogf/gf/v3/container/gtype"
"github.com/gogf/gf/v3/container/gatomic"
"github.com/gogf/gf/v3/container/gvar"
"github.com/gogf/gf/v3/encoding/gjson"
"github.com/gogf/gf/v3/frame/g"
@ -152,7 +152,7 @@ func Test_Issue1607(t *testing.T) {
func Test_Issue1946(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
type B struct {
init *gtype.Bool
init *gatomic.Bool
Name string
}
type A struct {
@ -160,7 +160,7 @@ func Test_Issue1946(t *testing.T) {
}
a := &A{
B: &B{
init: gtype.NewBool(true),
init: gatomic.NewBool(true),
},
}
err := gconv.Struct(g.Map{
@ -175,7 +175,7 @@ func Test_Issue1946(t *testing.T) {
// It cannot change private attribute.
gtest.C(t, func(t *gtest.T) {
type B struct {
init *gtype.Bool
init *gatomic.Bool
Name string
}
type A struct {
@ -183,7 +183,7 @@ func Test_Issue1946(t *testing.T) {
}
a := &A{
B: &B{
init: gtype.NewBool(true),
init: gatomic.NewBool(true),
},
}
err := gconv.Struct(g.Map{
@ -199,7 +199,7 @@ func Test_Issue1946(t *testing.T) {
// It can change public attribute.
gtest.C(t, func(t *gtest.T) {
type B struct {
Init *gtype.Bool
Init *gatomic.Bool
Name string
}
type A struct {
@ -207,7 +207,7 @@ func Test_Issue1946(t *testing.T) {
}
a := &A{
B: &B{
Init: gtype.NewBool(),
Init: gatomic.NewBool(),
},
}
err := gconv.Struct(g.Map{
@ -733,12 +733,12 @@ func Test_Issue3821(t *testing.T) {
type User struct {
InnerUser
UserId int `orm:"user_id"`
UserIdBool gtype.Bool `orm:"user_id"`
Username string `orm:"user_name"`
Username2 string `orm:"user_name"`
Username3 *string `orm:"user_name"`
Username4 string `orm:"username"` // empty string
UserId int `orm:"user_id"`
UserIdBool gatomic.Bool `orm:"user_id"`
Username string `orm:"user_name"`
Username2 string `orm:"user_name"`
Username3 *string `orm:"user_name"`
Username4 string `orm:"username"` // empty string
}
var user = &User{}
err := gconv.StructTag(record, user, "orm")

View File

@ -12,7 +12,7 @@ import (
"strconv"
"time"
"github.com/gogf/gf/v3/container/gtype"
"github.com/gogf/gf/v3/container/gatomic"
"github.com/gogf/gf/v3/encoding/ghash"
"github.com/gogf/gf/v3/errors/gcode"
"github.com/gogf/gf/v3/errors/gerror"
@ -26,9 +26,9 @@ const (
)
var (
sequence gtype.Uint32 // Sequence for unique purpose of the current process.
macAddrStr = "0000000" // Hash result of MAC addresses in 7 bytes.
processIdStr = "0000" // Process id in 4 bytes.
sequence gatomic.Uint32 // Sequence for unique purpose of the current process.
macAddrStr = "0000000" // Hash result of MAC addresses in 7 bytes.
processIdStr = "0000" // Process id in 4 bytes.
)
// init initializes several fixed local variable.

View File

@ -10,7 +10,7 @@ import (
"bytes"
"testing"
"github.com/gogf/gf/v3/container/gtype"
"github.com/gogf/gf/v3/container/gatomic"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/net/ghttp"
"github.com/gogf/gf/v3/os/gtime"
@ -76,7 +76,7 @@ func Test_Dump(t *testing.T) {
gutil.Dump(make(chan int))
gutil.Dump(func() {})
gutil.Dump(nil)
gutil.Dump(gtype.NewInt(1))
gutil.Dump(gatomic.NewInt(1))
})
}