diff --git a/.example/container/garray/basic_array.go b/.example/container/garray/basic_array.go
index 7a74ec957..3db377d4d 100644
--- a/.example/container/garray/basic_array.go
+++ b/.example/container/garray/basic_array.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/garray"
+ "github.com/gogf/gf/v2/container/garray"
)
func main() {
diff --git a/.example/container/garray/json_marshal.go b/.example/container/garray/json_marshal.go
index c27424c5b..4f5859413 100644
--- a/.example/container/garray/json_marshal.go
+++ b/.example/container/garray/json_marshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/garray"
+ "github.com/gogf/gf/v2/container/garray"
)
func main() {
diff --git a/.example/container/garray/json_unmarshal.go b/.example/container/garray/json_unmarshal.go
index 07e81adb0..144287a99 100644
--- a/.example/container/garray/json_unmarshal.go
+++ b/.example/container/garray/json_unmarshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/garray"
+ "github.com/gogf/gf/v2/container/garray"
)
func main() {
diff --git a/.example/container/garray/sorted_array_basic.go b/.example/container/garray/sorted_array_basic.go
index a1792551b..81e0531f8 100644
--- a/.example/container/garray/sorted_array_basic.go
+++ b/.example/container/garray/sorted_array_basic.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/garray"
+ "github.com/gogf/gf/v2/container/garray"
)
func main() {
diff --git a/.example/container/garray/sorted_string_array.go b/.example/container/garray/sorted_string_array.go
index 109fe31c5..a89de1f46 100644
--- a/.example/container/garray/sorted_string_array.go
+++ b/.example/container/garray/sorted_string_array.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/garray"
+ "github.com/gogf/gf/v2/container/garray"
)
func main() {
diff --git a/.example/container/glist/basic.go b/.example/container/glist/basic.go
index 73889c9ea..a904ea345 100644
--- a/.example/container/glist/basic.go
+++ b/.example/container/glist/basic.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/glist"
+ "github.com/gogf/gf/v2/container/glist"
)
func main() {
diff --git a/.example/container/glist/json_marshal.go b/.example/container/glist/json_marshal.go
index f6daafa06..00cc3409b 100644
--- a/.example/container/glist/json_marshal.go
+++ b/.example/container/glist/json_marshal.go
@@ -3,8 +3,8 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/glist"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/container/glist"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/container/glist/json_unmarshal.go b/.example/container/glist/json_unmarshal.go
index 313dfe570..7b03f7cff 100644
--- a/.example/container/glist/json_unmarshal.go
+++ b/.example/container/glist/json_unmarshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/glist"
+ "github.com/gogf/gf/v2/container/glist"
)
func main() {
diff --git a/.example/container/gmap/basic.go b/.example/container/gmap/basic.go
index 4fb984930..4d9b5a453 100644
--- a/.example/container/gmap/basic.go
+++ b/.example/container/gmap/basic.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gmap"
+ "github.com/gogf/gf/v2/container/gmap"
)
func main() {
diff --git a/.example/container/gmap/gmap_json_marshal.go b/.example/container/gmap/gmap_json_marshal.go
index 1aae8c385..76ac64630 100644
--- a/.example/container/gmap/gmap_json_marshal.go
+++ b/.example/container/gmap/gmap_json_marshal.go
@@ -3,9 +3,9 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/container/gmap"
+ "github.com/gogf/gf/v2/container/gmap"
)
func main() {
diff --git a/.example/container/gmap/gmap_json_unmarshal.go b/.example/container/gmap/gmap_json_unmarshal.go
index af3c134a8..7f5a9d24a 100644
--- a/.example/container/gmap/gmap_json_unmarshal.go
+++ b/.example/container/gmap/gmap_json_unmarshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/gmap"
+ "github.com/gogf/gf/v2/container/gmap"
)
func main() {
diff --git a/.example/container/gmap/gmap_map_clone_safe.go b/.example/container/gmap/gmap_map_clone_safe.go
index 95a8662d5..912ea9eff 100644
--- a/.example/container/gmap/gmap_map_clone_safe.go
+++ b/.example/container/gmap/gmap_map_clone_safe.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/container/gmap"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/container/gmap"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/container/gmap/gmap_maps.go b/.example/container/gmap/gmap_maps.go
index 9054ac70c..7b7267b1b 100644
--- a/.example/container/gmap/gmap_maps.go
+++ b/.example/container/gmap/gmap_maps.go
@@ -3,9 +3,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gmap"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/container/gmap"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gutil"
)
func main() {
diff --git a/.example/container/gmap/gmap_treemap.go b/.example/container/gmap/gmap_treemap.go
index 262dd1219..d495ac336 100644
--- a/.example/container/gmap/gmap_treemap.go
+++ b/.example/container/gmap/gmap_treemap.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gmap"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/container/gmap"
+ "github.com/gogf/gf/v2/util/gutil"
)
func main() {
diff --git a/.example/container/gpool/gpool.go b/.example/container/gpool/gpool.go
index 771c12edf..a027dcba5 100644
--- a/.example/container/gpool/gpool.go
+++ b/.example/container/gpool/gpool.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/container/gpool"
+ "github.com/gogf/gf/v2/container/gpool"
)
func main() {
diff --git a/.example/container/gpool/gpool_expirefunc.go b/.example/container/gpool/gpool_expirefunc.go
index cc490b1d4..36ded0980 100644
--- a/.example/container/gpool/gpool_expirefunc.go
+++ b/.example/container/gpool/gpool_expirefunc.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/container/gpool"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/container/gpool"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
@@ -14,7 +14,7 @@ func main() {
p := gpool.New(3000*time.Millisecond, func() (interface{}, error) {
return gtcp.NewConn("www.baidu.com:80")
}, func(i interface{}) {
- glog.Println("expired")
+ glog.Print("expired")
i.(*gtcp.Conn).Close()
})
conn, err := p.Get()
diff --git a/.example/container/gqueue/gqueue.go b/.example/container/gqueue/gqueue.go
index 85985128c..5a1474330 100644
--- a/.example/container/gqueue/gqueue.go
+++ b/.example/container/gqueue/gqueue.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/container/gqueue"
- "github.com/gogf/gf/os/gtime"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/container/gqueue"
+ "github.com/gogf/gf/v2/os/gtime"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/container/gqueue/gqueue2.go b/.example/container/gqueue/gqueue2.go
index ca8ec4fa2..6b5459c47 100644
--- a/.example/container/gqueue/gqueue2.go
+++ b/.example/container/gqueue/gqueue2.go
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/container/gqueue"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/container/gqueue"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/container/gqueue/gqueue3.go b/.example/container/gqueue/gqueue3.go
index 9c30d0888..55c279a4c 100644
--- a/.example/container/gqueue/gqueue3.go
+++ b/.example/container/gqueue/gqueue3.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/container/gqueue"
- "github.com/gogf/gf/os/gtime"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/container/gqueue"
+ "github.com/gogf/gf/v2/os/gtime"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/container/gring/gring.go b/.example/container/gring/gring.go
index 6a15f42d6..871c4b9c2 100644
--- a/.example/container/gring/gring.go
+++ b/.example/container/gring/gring.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gring"
+ "github.com/gogf/gf/v2/container/gring"
)
func main() {
diff --git a/.example/container/gring/gring_josephus.go b/.example/container/gring/gring_josephus.go
index 5aafd5b46..078c31b5e 100644
--- a/.example/container/gring/gring_josephus.go
+++ b/.example/container/gring/gring_josephus.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gring"
+ "github.com/gogf/gf/v2/container/gring"
)
type Player struct {
diff --git a/.example/container/gset/gset1.go b/.example/container/gset/gset1.go
index b4c18a341..2033edf3c 100644
--- a/.example/container/gset/gset1.go
+++ b/.example/container/gset/gset1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gset"
+ "github.com/gogf/gf/v2/container/gset"
)
func main() {
diff --git a/.example/container/gset/gset2.go b/.example/container/gset/gset2.go
index 051c9204f..25fc11762 100644
--- a/.example/container/gset/gset2.go
+++ b/.example/container/gset/gset2.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gset"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/container/gset"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/container/gset/json_marshal.go b/.example/container/gset/json_marshal.go
index 18f308caf..a554f1e3b 100644
--- a/.example/container/gset/json_marshal.go
+++ b/.example/container/gset/json_marshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/gset"
+ "github.com/gogf/gf/v2/container/gset"
)
func main() {
diff --git a/.example/container/gset/json_unmarshal.go b/.example/container/gset/json_unmarshal.go
index 4e90ce823..a71208a31 100644
--- a/.example/container/gset/json_unmarshal.go
+++ b/.example/container/gset/json_unmarshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/gset"
+ "github.com/gogf/gf/v2/container/gset"
)
func main() {
diff --git a/.example/container/gtree/gtree_avltree.go b/.example/container/gtree/gtree_avltree.go
index 9f55d4395..5814212ec 100644
--- a/.example/container/gtree/gtree_avltree.go
+++ b/.example/container/gtree/gtree_avltree.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gtree"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/container/gtree"
+ "github.com/gogf/gf/v2/util/gutil"
)
func main() {
diff --git a/.example/container/gtree/gtree_btree.go b/.example/container/gtree/gtree_btree.go
index 268068435..f1b04d66b 100644
--- a/.example/container/gtree/gtree_btree.go
+++ b/.example/container/gtree/gtree_btree.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gtree"
+ "github.com/gogf/gf/v2/container/gtree"
)
func main() {
diff --git a/.example/container/gtree/gtree_redblackmap.go b/.example/container/gtree/gtree_redblackmap.go
index d1b7e8b2e..5689110a2 100644
--- a/.example/container/gtree/gtree_redblackmap.go
+++ b/.example/container/gtree/gtree_redblackmap.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gtree"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/container/gtree"
+ "github.com/gogf/gf/v2/util/gutil"
)
func main() {
diff --git a/.example/container/gtree/gtree_redblacktree.go b/.example/container/gtree/gtree_redblacktree.go
index 557478663..01bbafb69 100644
--- a/.example/container/gtree/gtree_redblacktree.go
+++ b/.example/container/gtree/gtree_redblacktree.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/container/gtree"
+ "github.com/gogf/gf/v2/container/gtree"
)
func main() {
diff --git a/.example/container/gtype/gtype_int.go b/.example/container/gtype/gtype_int.go
index e44949b02..ba8307290 100644
--- a/.example/container/gtype/gtype_int.go
+++ b/.example/container/gtype/gtype_int.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/container/gtype"
+ "github.com/gogf/gf/v2/container/gtype"
)
func main() {
diff --git a/.example/container/gtype/json_marshal.go b/.example/container/gtype/json_marshal.go
index 80052d23f..e91e4d7d9 100644
--- a/.example/container/gtype/json_marshal.go
+++ b/.example/container/gtype/json_marshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/gtype"
+ "github.com/gogf/gf/v2/container/gtype"
)
func main() {
diff --git a/.example/container/gtype/json_unmarshal.go b/.example/container/gtype/json_unmarshal.go
index 6b72cab08..d460cfc67 100644
--- a/.example/container/gtype/json_unmarshal.go
+++ b/.example/container/gtype/json_unmarshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/container/gtype"
+ "github.com/gogf/gf/v2/container/gtype"
)
func main() {
diff --git a/.example/container/gvar/json_marshal.go b/.example/container/gvar/json_marshal.go
index c8479a1eb..fbbb01679 100644
--- a/.example/container/gvar/json_marshal.go
+++ b/.example/container/gvar/json_marshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/container/gvar/json_unmarshal.go b/.example/container/gvar/json_unmarshal.go
index 31aa9843a..2e79601e7 100644
--- a/.example/container/gvar/json_unmarshal.go
+++ b/.example/container/gvar/json_unmarshal.go
@@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/container/gvar/var.go b/.example/container/gvar/var.go
index fe688e674..7752eed11 100644
--- a/.example/container/gvar/var.go
+++ b/.example/container/gvar/var.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/driver/driver/driver.go b/.example/database/gdb/driver/driver/driver.go
index 71af8399d..9350832c1 100644
--- a/.example/database/gdb/driver/driver/driver.go
+++ b/.example/database/gdb/driver/driver/driver.go
@@ -3,8 +3,8 @@ package driver
import (
"context"
"database/sql"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/os/gtime"
)
// MyDriver is a custom database driver, which is used for testing only.
diff --git a/.example/database/gdb/mssql/gdb_all.go b/.example/database/gdb/mssql/gdb_all.go
index da70660b5..396099c6a 100644
--- a/.example/database/gdb/mssql/gdb_all.go
+++ b/.example/database/gdb/mssql/gdb_all.go
@@ -2,22 +2,22 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
- _ "github.com/denisenkom/go-mssqldb"
- "github.com/gogf/gf/frame/g"
+ //_ "github.com/denisenkom/go-mssqldb"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
type Table2 struct {
Id string `orm:"id;pr" json:"id"` //ID
- Createtime gtime.Time `orm:"createtime" json:"createtime"` //创建时间
- Updatetime gtime.Time `orm:"updatetime" json:"updatetime"` //更新时间
+ CreateTime gtime.Time `orm:"createtime" json:"createtime"` //创建时间
+ UpdateTime gtime.Time `orm:"updatetime" json:"updatetime"` //更新时间
}
var table2 Table2
- err := g.DB().Table("table2").Where("id=?", 1).Struct(&table2)
+ err := g.DB().Model("table2").Where("id", 1).Scan(&table2)
if err != nil {
panic(err)
}
- fmt.Println(table2.Createtime)
+ fmt.Println(table2.CreateTime)
}
diff --git a/.example/database/gdb/mssql/gdb_sqlserver.go b/.example/database/gdb/mssql/gdb_sqlserver.go
index 0b81c802f..1281f0e08 100644
--- a/.example/database/gdb/mssql/gdb_sqlserver.go
+++ b/.example/database/gdb/mssql/gdb_sqlserver.go
@@ -5,8 +5,8 @@ import (
"time"
//_ "github.com/denisenkom/go-mssqldb"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
)
// 本文件用于gf框架的mssql数据库操作示例,不作为单元测试使用
diff --git a/.example/database/gdb/mysql/config/gdb.go b/.example/database/gdb/mysql/config/gdb.go
index 75e92e9d1..3dcb15ddd 100644
--- a/.example/database/gdb/mysql/config/gdb.go
+++ b/.example/database/gdb/mysql/config/gdb.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/os/gctx"
"sync"
"time"
)
diff --git a/.example/database/gdb/mysql/gdb_all.go b/.example/database/gdb/mysql/gdb_all.go
index 355424f03..38c5e3409 100644
--- a/.example/database/gdb/mysql/gdb_all.go
+++ b/.example/database/gdb/mysql/gdb_all.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_args_slice.go b/.example/database/gdb/mysql/gdb_args_slice.go
index 68c346dc9..88496f345 100644
--- a/.example/database/gdb/mysql/gdb_args_slice.go
+++ b/.example/database/gdb/mysql/gdb_args_slice.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_batch_insert.go b/.example/database/gdb/mysql/gdb_batch_insert.go
index 62c8a2e38..cdc2e7b36 100644
--- a/.example/database/gdb/mysql/gdb_batch_insert.go
+++ b/.example/database/gdb/mysql/gdb_batch_insert.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_binary.go b/.example/database/gdb/mysql/gdb_binary.go
index eeba8987e..e0f0b4f6b 100644
--- a/.example/database/gdb/mysql/gdb_binary.go
+++ b/.example/database/gdb/mysql/gdb_binary.go
@@ -2,11 +2,11 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gctx"
- "github.com/gogf/gf/crypto/gaes"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/crypto/gaes"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_bit.go b/.example/database/gdb/mysql/gdb_bit.go
index ce2c729e0..f08133af1 100644
--- a/.example/database/gdb/mysql/gdb_bit.go
+++ b/.example/database/gdb/mysql/gdb_bit.go
@@ -2,9 +2,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gctx"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_cache.go b/.example/database/gdb/mysql/gdb_cache.go
index 90f812ff2..35583865b 100644
--- a/.example/database/gdb/mysql/gdb_cache.go
+++ b/.example/database/gdb/mysql/gdb_cache.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/os/gctx"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/os/gctx"
+ "github.com/gogf/gf/v2/util/gutil"
"time"
)
diff --git a/.example/database/gdb/mysql/gdb_complecated.go b/.example/database/gdb/mysql/gdb_complecated.go
index eeaddebe3..b8af08994 100644
--- a/.example/database/gdb/mysql/gdb_complecated.go
+++ b/.example/database/gdb/mysql/gdb_complecated.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_config.go b/.example/database/gdb/mysql/gdb_config.go
index 4f6a809a3..9e0efa73d 100644
--- a/.example/database/gdb/mysql/gdb_config.go
+++ b/.example/database/gdb/mysql/gdb_config.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_config2.go b/.example/database/gdb/mysql/gdb_config2.go
index ca6fb4ebd..15120d2d0 100644
--- a/.example/database/gdb/mysql/gdb_config2.go
+++ b/.example/database/gdb/mysql/gdb_config2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_config3.go b/.example/database/gdb/mysql/gdb_config3.go
index 576e622fd..960c34a24 100644
--- a/.example/database/gdb/mysql/gdb_config3.go
+++ b/.example/database/gdb/mysql/gdb_config3.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_ctx.go b/.example/database/gdb/mysql/gdb_ctx.go
index 0572f08c2..a27edc2f9 100644
--- a/.example/database/gdb/mysql/gdb_ctx.go
+++ b/.example/database/gdb/mysql/gdb_ctx.go
@@ -2,7 +2,7 @@ package main
import (
"context"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_ctx_model.go b/.example/database/gdb/mysql/gdb_ctx_model.go
index fec1663f0..3d8796f9a 100644
--- a/.example/database/gdb/mysql/gdb_ctx_model.go
+++ b/.example/database/gdb/mysql/gdb_ctx_model.go
@@ -2,7 +2,7 @@ package main
import (
"context"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_datetime.go b/.example/database/gdb/mysql/gdb_datetime.go
index 1a4677bb9..317316ec3 100644
--- a/.example/database/gdb/mysql/gdb_datetime.go
+++ b/.example/database/gdb/mysql/gdb_datetime.go
@@ -2,10 +2,10 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gctx"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_debug1.go b/.example/database/gdb/mysql/gdb_debug1.go
index ecbceffe3..8eaa2e49d 100644
--- a/.example/database/gdb/mysql/gdb_debug1.go
+++ b/.example/database/gdb/mysql/gdb_debug1.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_debug2.go b/.example/database/gdb/mysql/gdb_debug2.go
index 2480dc420..0ab81ac21 100644
--- a/.example/database/gdb/mysql/gdb_debug2.go
+++ b/.example/database/gdb/mysql/gdb_debug2.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_distinct.go b/.example/database/gdb/mysql/gdb_distinct.go
index 189422f6b..c043102e9 100644
--- a/.example/database/gdb/mysql/gdb_distinct.go
+++ b/.example/database/gdb/mysql/gdb_distinct.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_insert.go b/.example/database/gdb/mysql/gdb_insert.go
index 61a0bd35b..a8a3f1bbd 100644
--- a/.example/database/gdb/mysql/gdb_insert.go
+++ b/.example/database/gdb/mysql/gdb_insert.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_issue_278.go b/.example/database/gdb/mysql/gdb_issue_278.go
index 160b9f317..4bcb82ffa 100644
--- a/.example/database/gdb/mysql/gdb_issue_278.go
+++ b/.example/database/gdb/mysql/gdb_issue_278.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
var (
diff --git a/.example/database/gdb/mysql/gdb_json_xml.go b/.example/database/gdb/mysql/gdb_json_xml.go
index 8be1b9163..ec986e321 100644
--- a/.example/database/gdb/mysql/gdb_json_xml.go
+++ b/.example/database/gdb/mysql/gdb_json_xml.go
@@ -2,11 +2,11 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/encoding/gjson"
+ "github.com/gogf/gf/v2/os/gctx"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/encoding/gparser"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
@@ -34,8 +34,8 @@ func main() {
fmt.Println(one.Xml())
// 自定义方法方法转换为json/xml
- jsonContent, _ := gparser.VarToJson(one.Map())
+ jsonContent, _ := gjson.New(one.Map()).ToJson()
fmt.Println(string(jsonContent))
- xmlContent, _ := gparser.VarToXml(one.Map())
+ xmlContent, _ := gjson.New(one.Map()).ToJson()
fmt.Println(string(xmlContent))
}
diff --git a/.example/database/gdb/mysql/gdb_pool.go b/.example/database/gdb/mysql/gdb_pool.go
index dcfdd063a..1ef261186 100644
--- a/.example/database/gdb/mysql/gdb_pool.go
+++ b/.example/database/gdb/mysql/gdb_pool.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gctx"
"time"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_reconnect.go b/.example/database/gdb/mysql/gdb_reconnect.go
index fbbb594d9..4ae644c99 100644
--- a/.example/database/gdb/mysql/gdb_reconnect.go
+++ b/.example/database/gdb/mysql/gdb_reconnect.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
"time"
)
diff --git a/.example/database/gdb/mysql/gdb_struct.go b/.example/database/gdb/mysql/gdb_struct.go
index dfe401475..5c1f421c8 100644
--- a/.example/database/gdb/mysql/gdb_struct.go
+++ b/.example/database/gdb/mysql/gdb_struct.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_tables.go b/.example/database/gdb/mysql/gdb_tables.go
index 6c84b9e1a..f179183c5 100644
--- a/.example/database/gdb/mysql/gdb_tables.go
+++ b/.example/database/gdb/mysql/gdb_tables.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_tables_fields.go b/.example/database/gdb/mysql/gdb_tables_fields.go
index fe6e412b5..96dff35ba 100644
--- a/.example/database/gdb/mysql/gdb_tables_fields.go
+++ b/.example/database/gdb/mysql/gdb_tables_fields.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_transaction.go b/.example/database/gdb/mysql/gdb_transaction.go
index fe5642ca2..a181829f4 100644
--- a/.example/database/gdb/mysql/gdb_transaction.go
+++ b/.example/database/gdb/mysql/gdb_transaction.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_transaction_closure.go b/.example/database/gdb/mysql/gdb_transaction_closure.go
index 9d38aef51..9c39a7db0 100644
--- a/.example/database/gdb/mysql/gdb_transaction_closure.go
+++ b/.example/database/gdb/mysql/gdb_transaction_closure.go
@@ -2,9 +2,9 @@ package main
import (
"context"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_transaction_savepoint.go b/.example/database/gdb/mysql/gdb_transaction_savepoint.go
index e677f15ab..13eba5d0b 100644
--- a/.example/database/gdb/mysql/gdb_transaction_savepoint.go
+++ b/.example/database/gdb/mysql/gdb_transaction_savepoint.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_update_field.go b/.example/database/gdb/mysql/gdb_update_field.go
index 9b420db20..e653469f0 100644
--- a/.example/database/gdb/mysql/gdb_update_field.go
+++ b/.example/database/gdb/mysql/gdb_update_field.go
@@ -3,10 +3,10 @@ package main
import (
"database/sql"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/os/gfile"
- "github.com/gogf/gf/encoding/gjson"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/encoding/gjson"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_update_union.go b/.example/database/gdb/mysql/gdb_update_union.go
index cf51e548a..edacbdbe7 100644
--- a/.example/database/gdb/mysql/gdb_update_union.go
+++ b/.example/database/gdb/mysql/gdb_update_union.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_value.go b/.example/database/gdb/mysql/gdb_value.go
index 3909df5d5..aace6c5b2 100644
--- a/.example/database/gdb/mysql/gdb_value.go
+++ b/.example/database/gdb/mysql/gdb_value.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_with_insert.go b/.example/database/gdb/mysql/gdb_with_insert.go
index b7ef3a15b..79e8e3d86 100644
--- a/.example/database/gdb/mysql/gdb_with_insert.go
+++ b/.example/database/gdb/mysql/gdb_with_insert.go
@@ -3,10 +3,10 @@ package main
import (
"context"
"fmt"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gctx"
- "github.com/gogf/gf/util/gmeta"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
+ "github.com/gogf/gf/v2/util/gmeta"
)
func main() {
diff --git a/.example/database/gdb/mysql/gdb_with_slect.go b/.example/database/gdb/mysql/gdb_with_slect.go
index e15cf40f9..327062e88 100644
--- a/.example/database/gdb/mysql/gdb_with_slect.go
+++ b/.example/database/gdb/mysql/gdb_with_slect.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gmeta"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gmeta"
)
func main() {
diff --git a/.example/database/gdb/mysql/issue364.go b/.example/database/gdb/mysql/issue364.go
index 164a8a9bd..2f84b1aaf 100644
--- a/.example/database/gdb/mysql/issue364.go
+++ b/.example/database/gdb/mysql/issue364.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"time"
)
diff --git a/.example/database/gdb/oracle/gdb.go b/.example/database/gdb/oracle/gdb.go
index 902015a13..c2f35661d 100644
--- a/.example/database/gdb/oracle/gdb.go
+++ b/.example/database/gdb/oracle/gdb.go
@@ -5,8 +5,8 @@ import (
"time"
//_ "github.com/mattn/go-oci8"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
)
// 本文件用于gf框架的mysql数据库操作示例,不作为单元测试使用
diff --git a/.example/database/gdb/sqlite/sqlite.go b/.example/database/gdb/sqlite/sqlite.go
index 6224914ee..4160d5f4d 100644
--- a/.example/database/gdb/sqlite/sqlite.go
+++ b/.example/database/gdb/sqlite/sqlite.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
_ "github.com/mattn/go-sqlite3"
)
diff --git a/.example/database/gredis/gredis.go b/.example/database/gredis/gredis.go
index a276da6f9..32815d06c 100644
--- a/.example/database/gredis/gredis.go
+++ b/.example/database/gredis/gredis.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/database/gredis"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/database/gredis"
+ "github.com/gogf/gf/v2/util/gconv"
)
// 使用原生gredis.New操作redis,但是注意需要自己调用Close方法关闭redis链接池
diff --git a/.example/database/gredis/gredis2.go b/.example/database/gredis/gredis2.go
index d4ef9aaeb..e141cb06e 100644
--- a/.example/database/gredis/gredis2.go
+++ b/.example/database/gredis/gredis2.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
// 使用框架封装的g.Redis()方法获得redis操作对象单例,不需要开发者显示调用Close方法
diff --git a/.example/database/gredis/gredis_conn_do.go b/.example/database/gredis/gredis_conn_do.go
index a87e993ba..6f3f2c6a2 100644
--- a/.example/database/gredis/gredis_conn_do.go
+++ b/.example/database/gredis/gredis_conn_do.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/database/gredis/gredis_conn_do_var.go b/.example/database/gredis/gredis_conn_do_var.go
index c19c29cbc..363d762ed 100644
--- a/.example/database/gredis/gredis_conn_do_var.go
+++ b/.example/database/gredis/gredis_conn_do_var.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gredis/gredis_conn_send.go b/.example/database/gredis/gredis_conn_send.go
index a6d6156ac..727e38ffc 100644
--- a/.example/database/gredis/gredis_conn_send.go
+++ b/.example/database/gredis/gredis_conn_send.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/database/gredis/gredis_conn_send_var.go b/.example/database/gredis/gredis_conn_send_var.go
index 5ad22b84e..019582ddd 100644
--- a/.example/database/gredis/gredis_conn_send_var.go
+++ b/.example/database/gredis/gredis_conn_send_var.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/database/gredis/gredis_conn_subscribe.go b/.example/database/gredis/gredis_conn_subscribe.go
index 40a2e6955..7baf3a62d 100644
--- a/.example/database/gredis/gredis_conn_subscribe.go
+++ b/.example/database/gredis/gredis_conn_subscribe.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/database/gredis/gredis_conn_subscribe_var.go b/.example/database/gredis/gredis_conn_subscribe_var.go
index bb8857cb7..d171d2cac 100644
--- a/.example/database/gredis/gredis_conn_subscribe_var.go
+++ b/.example/database/gredis/gredis_conn_subscribe_var.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/debug/gdebug/gdebug.go b/.example/debug/gdebug/gdebug.go
index 2410096a9..2c67adf32 100644
--- a/.example/debug/gdebug/gdebug.go
+++ b/.example/debug/gdebug/gdebug.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/debug/gdebug"
+ "github.com/gogf/gf/v2/debug/gdebug"
)
func main() {
diff --git a/.example/debug/gdebug/gdebug_info.go b/.example/debug/gdebug/gdebug_info.go
index 0e07ca12b..a829d8a7f 100644
--- a/.example/debug/gdebug/gdebug_info.go
+++ b/.example/debug/gdebug/gdebug_info.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/debug/gdebug"
+ "github.com/gogf/gf/v2/debug/gdebug"
)
func main() {
diff --git a/.example/encoding/gbase64/gbase64.go b/.example/encoding/gbase64/gbase64.go
index ecf665407..e87206a9c 100644
--- a/.example/encoding/gbase64/gbase64.go
+++ b/.example/encoding/gbase64/gbase64.go
@@ -3,7 +3,7 @@ package gbase64
import (
"fmt"
- "github.com/gogf/gf/encoding/gbase64"
+ "github.com/gogf/gf/v2/encoding/gbase64"
)
func main() {
diff --git a/.example/encoding/gbinary/binary.go b/.example/encoding/gbinary/binary.go
index de2f5e1ec..53e1e81de 100644
--- a/.example/encoding/gbinary/binary.go
+++ b/.example/encoding/gbinary/binary.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gbinary"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/encoding/gbinary"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/encoding/gbinary/bits1.go b/.example/encoding/gbinary/bits1.go
index 973e589bb..6d2696157 100644
--- a/.example/encoding/gbinary/bits1.go
+++ b/.example/encoding/gbinary/bits1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gbinary"
+ "github.com/gogf/gf/v2/encoding/gbinary"
)
func main() {
diff --git a/.example/encoding/gbinary/bits2.go b/.example/encoding/gbinary/bits2.go
index 0332cf362..d85d04cb8 100644
--- a/.example/encoding/gbinary/bits2.go
+++ b/.example/encoding/gbinary/bits2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gbinary"
+ "github.com/gogf/gf/v2/encoding/gbinary"
)
func main() {
diff --git a/.example/encoding/gcfg/gcfg1.go b/.example/encoding/gcfg/gcfg1.go
index a9414223e..b59e0af91 100644
--- a/.example/encoding/gcfg/gcfg1.go
+++ b/.example/encoding/gcfg/gcfg1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/encoding/gcharset/gcharset.go b/.example/encoding/gcharset/gcharset.go
index 07d2d37ec..cf3a8017a 100644
--- a/.example/encoding/gcharset/gcharset.go
+++ b/.example/encoding/gcharset/gcharset.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gcharset"
+ "github.com/gogf/gf/v2/encoding/gcharset"
)
func main() {
diff --git a/.example/encoding/gcompress/unzip.go b/.example/encoding/gcompress/unzip.go
index 9f983fb3e..112b1977f 100644
--- a/.example/encoding/gcompress/unzip.go
+++ b/.example/encoding/gcompress/unzip.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gcompress"
+ "github.com/gogf/gf/v2/encoding/gcompress"
)
func main() {
diff --git a/.example/encoding/gcompress/unzip_content.go b/.example/encoding/gcompress/unzip_content.go
index c6e25efed..b5d464998 100644
--- a/.example/encoding/gcompress/unzip_content.go
+++ b/.example/encoding/gcompress/unzip_content.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gcompress"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/encoding/gcompress"
+ "github.com/gogf/gf/v2/os/gfile"
)
func main() {
diff --git a/.example/encoding/gcompress/zip.go b/.example/encoding/gcompress/zip.go
index c827c1d4f..6e055200d 100644
--- a/.example/encoding/gcompress/zip.go
+++ b/.example/encoding/gcompress/zip.go
@@ -3,7 +3,7 @@ package main
import (
"archive/zip"
"fmt"
- "github.com/gogf/gf/encoding/gcompress"
+ "github.com/gogf/gf/v2/encoding/gcompress"
"io"
"os"
"path/filepath"
diff --git a/.example/encoding/ghash/ghash_repeat_check.go b/.example/encoding/ghash/ghash_repeat_check.go
index da613411c..8451b1bc6 100644
--- a/.example/encoding/ghash/ghash_repeat_check.go
+++ b/.example/encoding/ghash/ghash_repeat_check.go
@@ -4,7 +4,7 @@ import (
"fmt"
"strconv"
- "github.com/gogf/gf/encoding/ghash"
+ "github.com/gogf/gf/v2/encoding/ghash"
)
func main() {
diff --git a/.example/encoding/gini/gini.go b/.example/encoding/gini/gini.go
index 758c5210b..9e6c55a58 100644
--- a/.example/encoding/gini/gini.go
+++ b/.example/encoding/gini/gini.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gini"
+ "github.com/gogf/gf/v2/encoding/gini"
)
func main() {
diff --git a/.example/encoding/gjson/gjson.go b/.example/encoding/gjson/gjson.go
index 5b2510930..07da40f89 100644
--- a/.example/encoding/gjson/gjson.go
+++ b/.example/encoding/gjson/gjson.go
@@ -3,9 +3,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gjson"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/encoding/gjson"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func getByPattern() {
diff --git a/.example/encoding/gjson/issue#IZXU2.go b/.example/encoding/gjson/issue#IZXU2.go
index e96f428d3..abbbc7fd9 100644
--- a/.example/encoding/gjson/issue#IZXU2.go
+++ b/.example/encoding/gjson/issue#IZXU2.go
@@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/encoding/gjson"
+ "github.com/gogf/gf/v2/encoding/gjson"
)
type XinYanModel struct {
diff --git a/.example/encoding/gjson/issue283.go b/.example/encoding/gjson/issue283.go
index 7e01a7926..52b20a274 100644
--- a/.example/encoding/gjson/issue283.go
+++ b/.example/encoding/gjson/issue283.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/encoding/gjson"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/encoding/gjson"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/glog"
)
type GameUser struct {
diff --git a/.example/encoding/gjson/issue360.go b/.example/encoding/gjson/issue360.go
index dc0f9555c..7b753f312 100644
--- a/.example/encoding/gjson/issue360.go
+++ b/.example/encoding/gjson/issue360.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gjson"
+ "github.com/gogf/gf/v2/encoding/gjson"
)
func main() {
diff --git a/.example/encoding/gparser/config.yaml b/.example/encoding/gparser/config.yaml
deleted file mode 100644
index 7fe5f397a..000000000
--- a/.example/encoding/gparser/config.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-broker:
- ip: "127.0.0.1"
- tcpport: "4222"
- httpport: "8222"
- user: "alfxnats"
- pwd: "alfxnats"
- clusterid: "alfxnats"
-database:
- ip: "110.1.1.227"
- port: "27017"
- user: "alfxdev"
- pwd: "alfxdev"
- dbname: "alfxdev"
-scheduler:
- a2rparallel: 4
- sleeptime: 300
-worker:
- name: "worker1"
- domains:
- officenet: 3
- producnet: 3
- free: 3
- temppath: "/home/alfx/proc"
-common:
- filepath: "/home/alfx/file"
- logpath: "home/alfx/log"
- logdebug: true
- logtrace: true
-report:
- localip: "127.0.0.1"
- localport: ""
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.example/encoding/gparser/gparser.go b/.example/encoding/gparser/gparser.go
deleted file mode 100644
index df42f1ffd..000000000
--- a/.example/encoding/gparser/gparser.go
+++ /dev/null
@@ -1,217 +0,0 @@
-package main
-
-import (
- "fmt"
-
- "github.com/gogf/gf/encoding/gparser"
- "github.com/gogf/gf/os/glog"
-)
-
-func getWithPattern1() {
- data :=
- `{
- "users" : {
- "count" : 100,
- "list" : [
- {"name" : "Ming", "score" : 60},
- {"name" : "John", "score" : 99.5}
- ]
- }
- }`
-
- if p, e := gparser.LoadContent([]byte(data)); e != nil {
- glog.Error(e)
- } else {
- fmt.Println("John Score:", p.GetFloat32("users.list.1.score"))
- }
-}
-
-func getWithPattern2() {
- data :=
- `
-
- Tove
- Jani
- Reminder
- Don't forget me this weekend!
- `
-
- if p, e := gparser.LoadContent([]byte(data)); e != nil {
- glog.Error(e)
- } else {
- fmt.Println("Heading:", p.GetString("note.heading"))
- }
-}
-
-// 当键名存在"."号时,检索优先级:键名->层级,因此不会引起歧义
-func multiDots1() {
- data :=
- `{
- "users" : {
- "count" : 100
- },
- "users.count" : 101
- }`
- if p, e := gparser.LoadContent([]byte(data)); e != nil {
- glog.Error(e)
- } else {
- fmt.Println("Users Count:", p.Get("users.count"))
- }
-}
-
-func multiDots2() {
- data :=
- `{
- "users" : {
- "count" : {
- "type1" : 1,
- "type2" : 2
- },
- "count.type1" : 100
- }
- }`
- if p, e := gparser.LoadContent([]byte(data)); e != nil {
- glog.Error(e)
- } else {
- fmt.Println("Users Count:", p.Get("users.count.type1"))
- fmt.Println("Users Count:", p.Get("users.count.type2"))
- }
-}
-
-// 设置数据
-func set1() {
- data :=
- `
-
- 10
- gf article1gf content1
- gf article2gf content2
- gf article3gf content3
- `
- if p, e := gparser.LoadContent([]byte(data)); e != nil {
- glog.Error(e)
- } else {
- p.Set("article.list.0", nil)
- c, _ := p.ToJson()
- fmt.Println(string(c))
- // {"article":{"count":"10","list":[{"content":"gf content2","title":"gf article2"},{"content":"gf content3","title":"gf article3"}]}}
- }
-}
-
-func set2() {
- data :=
- `{
- "users" : {
- "count" : 100
- }
- }`
- if p, e := gparser.LoadContent([]byte(data)); e != nil {
- glog.Error(e)
- } else {
- p.Set("users.count", 1)
- p.Set("users.list", []string{"John", "小明"})
- c, _ := p.ToJson()
- fmt.Println(string(c))
- }
-}
-
-func makeXml1() {
- p := gparser.New(nil)
- p.Set("name", "john")
- p.Set("age", 18)
- p.Set("scores", map[string]int{
- "语文": 100,
- "数学": 100,
- "英语": 100,
- })
- c, _ := p.ToXmlIndent("simple-xml")
- fmt.Println(string(c))
-}
-
-func makeJson1() {
- type Order struct {
- Id int `json:"id"`
- Price float32 `json:"price"`
- }
- p := gparser.New(nil)
- p.Set("orders.list.0", Order{1, 100})
- p.Set("orders.list.1", Order{2, 666})
- p.Set("orders.list.2", Order{3, 999.99})
- fmt.Println("Order 1 Price:", p.Get("orders.list.1.price"))
- c, _ := p.ToJson()
- fmt.Println(string(c))
-}
-
-func makeJson2() {
- p := gparser.New(map[string]string{
- "k1": "v1",
- "k2": "v2",
- })
- p.Set("k1.1", []int{1, 2, 3})
- //p.Set("0.0.1", []int{1,2,3})
- c, _ := p.ToJson()
- fmt.Println(string(c))
-}
-
-func makeJson3() {
- p := gparser.New([]string{"a"})
- p.Set("0.0.0", []int{1, 2, 3})
- c, _ := p.ToJson()
- fmt.Println(string(c))
-}
-
-func toStruct1() {
- type Info struct {
- Name string
- Url string
- }
- o := Info{}
- p := gparser.New(map[string]string{
- "Name": "gf",
- "Url": "https://gitee.com/johng",
- })
- p.ToStruct(&o)
- fmt.Println("Name:", o.Name)
- fmt.Println("Url :", o.Url)
-}
-
-func convert() {
- p := gparser.New(map[string]string{
- "name": "gf",
- "site": "https://gitee.com/johng",
- })
- c, _ := p.ToJson()
- fmt.Println("JSON:")
- fmt.Println(string(c))
- fmt.Println("======================")
-
- fmt.Println("XML:")
- c, _ = p.ToXmlIndent()
- fmt.Println(string(c))
- fmt.Println("======================")
-
- fmt.Println("YAML:")
- c, _ = p.ToYaml()
- fmt.Println(string(c))
- fmt.Println("======================")
-
- fmt.Println("TOML:")
- c, _ = p.ToToml()
- fmt.Println(string(c))
-
-}
-
-func remove1() {
- p := gparser.New(map[string]string{
- "k1": "v1",
- "k2": "v2",
- })
- p.Set("0.0.0.0.0.0.0.0", []int{1, 2, 3})
- p.Remove("0.0")
- c, _ := p.ToJson()
- fmt.Println(string(c))
-}
-
-func main() {
- toStruct1()
-}
diff --git a/.example/encoding/gparser/gparser_xml.go b/.example/encoding/gparser/gparser_xml.go
deleted file mode 100644
index 6d3ce48bb..000000000
--- a/.example/encoding/gparser/gparser_xml.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package main
-
-import "github.com/gogf/gf/encoding/gparser"
-
-func main() {
- xml := `
-
- `
- p, err := gparser.LoadContent([]byte(xml))
- if err != nil {
- panic(err)
- }
- p.Dump()
-}
diff --git a/.example/encoding/gparser/gparser_yaml_issue336.go b/.example/encoding/gparser/gparser_yaml_issue336.go
deleted file mode 100644
index ee796d16d..000000000
--- a/.example/encoding/gparser/gparser_yaml_issue336.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package main
-
-import (
- "fmt"
-
- "github.com/gogf/gf/encoding/gparser"
-)
-
-type Conf struct {
- Broker Broker
- Database Database
- Scheduler Scheduler
- Worker Worker
- Common Common
- Report Report
-}
-
-type Broker struct {
- Ip string
- Tcport string
- Httpport string
- User string
- Pwd string
- Clusterid string
-}
-
-type Database struct {
- Ip string
- Port string
- User string
- Pwd string
- Dbname string
-}
-
-type Scheduler struct {
- SleepTime int
- Pidfilepath string
- A2rparallel int
-}
-
-type Worker struct {
- Name string
- Domains map[string]interface{}
- Temppath string
- Pidfilepath string
-}
-
-type Common struct {
- Filepath string
- Logpath string
- Logdebug bool
- Logtrace bool
-}
-
-type Report struct {
- Localip string
- Localport string //暂不启用
-}
-
-func main() {
- _, err := gparser.Load("config.yaml")
- if err != nil {
- fmt.Println("oops,read config.yaml err:", err)
- }
-
- //fmt.Println("yaml.v3读取yaml文件")
- //f, err := os.Open("config.yaml")
- //if err != nil {
- // panic(err)
- //}
- //var conf Conf
- //err = yaml.NewDecoder(f).Decode(&conf)
- //if err != nil {
- // panic(err)
- //}
- //fmt.Println(conf)
-}
diff --git a/.example/encoding/gyaml/gyaml.go b/.example/encoding/gyaml/gyaml.go
index 20c4ae654..fc6380291 100644
--- a/.example/encoding/gyaml/gyaml.go
+++ b/.example/encoding/gyaml/gyaml.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/encoding/gyaml"
+ "github.com/gogf/gf/v2/encoding/gyaml"
)
func main() {
diff --git a/.example/errors/gerror/gerror1.go b/.example/errors/gerror/gerror1.go
index c644ae15d..32ed092e3 100644
--- a/.example/errors/gerror/gerror1.go
+++ b/.example/errors/gerror/gerror1.go
@@ -4,7 +4,7 @@ import (
"errors"
"fmt"
- "github.com/gogf/gf/errors/gerror"
+ "github.com/gogf/gf/v2/errors/gerror"
)
func Error1() error {
diff --git a/.example/errors/gerror/gerror2.go b/.example/errors/gerror/gerror2.go
index 4ae5e3b3a..0d78edd99 100644
--- a/.example/errors/gerror/gerror2.go
+++ b/.example/errors/gerror/gerror2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/errors/gerror"
+ "github.com/gogf/gf/v2/errors/gerror"
)
func OpenFile() error {
diff --git a/.example/errors/gerror/gerror3.go b/.example/errors/gerror/gerror3.go
index 30b67533f..007db4f0a 100644
--- a/.example/errors/gerror/gerror3.go
+++ b/.example/errors/gerror/gerror3.go
@@ -4,7 +4,7 @@ import (
"errors"
"fmt"
- "github.com/gogf/gf/errors/gerror"
+ "github.com/gogf/gf/v2/errors/gerror"
)
func Error1() error {
diff --git a/.example/errors/gerror/gerror4.go b/.example/errors/gerror/gerror4.go
index da2200080..03a10ac2e 100644
--- a/.example/errors/gerror/gerror4.go
+++ b/.example/errors/gerror/gerror4.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/errors/gerror"
+ "github.com/gogf/gf/v2/errors/gerror"
)
func OpenFile() error {
diff --git a/.example/errors/gerror/gerror5.go b/.example/errors/gerror/gerror5.go
index 709b719a0..56426ae37 100644
--- a/.example/errors/gerror/gerror5.go
+++ b/.example/errors/gerror/gerror5.go
@@ -3,9 +3,9 @@ package main
import (
"errors"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/glog"
- "github.com/gogf/gf/errors/gerror"
+ "github.com/gogf/gf/v2/errors/gerror"
)
func Error1() error {
@@ -17,6 +17,6 @@ func Error2() error {
}
func main() {
- glog.Println(Error1())
- glog.Println(Error2())
+ glog.Print(Error1())
+ glog.Print(Error2())
}
diff --git a/.example/i18n/gi18n/gi18n-dir.go b/.example/i18n/gi18n/gi18n-dir.go
index 552298176..f05751e85 100644
--- a/.example/i18n/gi18n/gi18n-dir.go
+++ b/.example/i18n/gi18n/gi18n-dir.go
@@ -4,7 +4,7 @@ import (
"context"
"fmt"
- "github.com/gogf/gf/i18n/gi18n"
+ "github.com/gogf/gf/v2/i18n/gi18n"
)
func main() {
diff --git a/.example/i18n/gi18n/gi18n-file.go b/.example/i18n/gi18n/gi18n-file.go
index f1a4423ee..3c81bf1f5 100644
--- a/.example/i18n/gi18n/gi18n-file.go
+++ b/.example/i18n/gi18n/gi18n-file.go
@@ -4,7 +4,7 @@ import (
"context"
"fmt"
- "github.com/gogf/gf/i18n/gi18n"
+ "github.com/gogf/gf/v2/i18n/gi18n"
)
func main() {
diff --git a/.example/i18n/gi18n/gi18n.go b/.example/i18n/gi18n/gi18n.go
index 17d830c0d..e54764bbf 100644
--- a/.example/i18n/gi18n/gi18n.go
+++ b/.example/i18n/gi18n/gi18n.go
@@ -3,8 +3,8 @@ package main
import (
"context"
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/i18n/gi18n"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/i18n/gi18n"
)
func main() {
diff --git a/.example/i18n/gi18n/http_view_i18n.go b/.example/i18n/gi18n/http_view_i18n.go
index cbf0b6e36..e38340288 100644
--- a/.example/i18n/gi18n/http_view_i18n.go
+++ b/.example/i18n/gi18n/http_view_i18n.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/i18n/gi18n"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/i18n/gi18n"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/i18n/gi18n/resource/gi18n-resource.go b/.example/i18n/gi18n/resource/gi18n-resource.go
index fa77596e0..7867b202c 100644
--- a/.example/i18n/gi18n/resource/gi18n-resource.go
+++ b/.example/i18n/gi18n/resource/gi18n-resource.go
@@ -3,9 +3,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
- _ "github.com/gogf/gf/os/gres/testdata"
+ _ "github.com/gogf/gf/v2/os/gres/testdata"
)
func main() {
diff --git a/.example/net/ghttp/client/cookie/client.go b/.example/net/ghttp/client/cookie/client.go
index 68d659488..212a81f6b 100644
--- a/.example/net/ghttp/client/cookie/client.go
+++ b/.example/net/ghttp/client/cookie/client.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/net/ghttp/client/cookie/server.go b/.example/net/ghttp/client/cookie/server.go
index 9b021a700..e262d9097 100644
--- a/.example/net/ghttp/client/cookie/server.go
+++ b/.example/net/ghttp/client/cookie/server.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/client/get.go b/.example/net/ghttp/client/get.go
index 0d64792cc..623073f3d 100644
--- a/.example/net/ghttp/client/get.go
+++ b/.example/net/ghttp/client/get.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/client/middleware/client.go b/.example/net/ghttp/client/middleware/client.go
index 7ba07b4bf..babba4fa5 100644
--- a/.example/net/ghttp/client/middleware/client.go
+++ b/.example/net/ghttp/client/middleware/client.go
@@ -3,15 +3,15 @@ package main
import (
"bytes"
"fmt"
- "github.com/gogf/gf/container/garray"
- "github.com/gogf/gf/crypto/gmd5"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/internal/json"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gtime"
- "github.com/gogf/gf/util/gconv"
- "github.com/gogf/gf/util/guid"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/container/garray"
+ "github.com/gogf/gf/v2/crypto/gmd5"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/internal/json"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gtime"
+ "github.com/gogf/gf/v2/util/gconv"
+ "github.com/gogf/gf/v2/util/guid"
+ "github.com/gogf/gf/v2/util/gutil"
"io/ioutil"
"net/http"
)
diff --git a/.example/net/ghttp/client/middleware/server.go b/.example/net/ghttp/client/middleware/server.go
index 8770dd634..8b431f89b 100644
--- a/.example/net/ghttp/client/middleware/server.go
+++ b/.example/net/ghttp/client/middleware/server.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/client/upload-batch/client.go b/.example/net/ghttp/client/upload-batch/client.go
index a0f6629f8..d8176b703 100644
--- a/.example/net/ghttp/client/upload-batch/client.go
+++ b/.example/net/ghttp/client/upload-batch/client.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/net/ghttp/client/upload-batch/client2.go b/.example/net/ghttp/client/upload-batch/client2.go
index 24568e951..7cc2963e5 100644
--- a/.example/net/ghttp/client/upload-batch/client2.go
+++ b/.example/net/ghttp/client/upload-batch/client2.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/net/ghttp/client/upload-batch/server.go b/.example/net/ghttp/client/upload-batch/server.go
index 482e1a7d6..5443dc298 100644
--- a/.example/net/ghttp/client/upload-batch/server.go
+++ b/.example/net/ghttp/client/upload-batch/server.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
// Upload uploads files to /tmp .
diff --git a/.example/net/ghttp/client/upload/client.go b/.example/net/ghttp/client/upload/client.go
index a26548029..606c5252a 100644
--- a/.example/net/ghttp/client/upload/client.go
+++ b/.example/net/ghttp/client/upload/client.go
@@ -2,11 +2,11 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"path/filepath"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func SendXmlFile(gameId int, areaName string, filePath string) error {
diff --git a/.example/net/ghttp/client/upload/server.go b/.example/net/ghttp/client/upload/server.go
index 26751703c..4573fae51 100644
--- a/.example/net/ghttp/client/upload/server.go
+++ b/.example/net/ghttp/client/upload/server.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
// Upload uploads files to /tmp .
diff --git a/.example/net/ghttp/server/admin/admin.go b/.example/net/ghttp/server/admin/admin.go
index 5a7ffd87e..640954823 100644
--- a/.example/net/ghttp/server/admin/admin.go
+++ b/.example/net/ghttp/server/admin/admin.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/body.go b/.example/net/ghttp/server/body.go
index cb31dc20d..ea762fd54 100644
--- a/.example/net/ghttp/server/body.go
+++ b/.example/net/ghttp/server/body.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
"io/ioutil"
)
diff --git a/.example/net/ghttp/server/controller/user.go b/.example/net/ghttp/server/controller/user.go
index 7b00b18b0..1fe010bbf 100644
--- a/.example/net/ghttp/server/controller/user.go
+++ b/.example/net/ghttp/server/controller/user.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/frame/gmvc"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/frame/gmvc"
)
type User struct {
diff --git a/.example/net/ghttp/server/controller/view.go b/.example/net/ghttp/server/controller/view.go
index 83302a526..70f3f96c3 100644
--- a/.example/net/ghttp/server/controller/view.go
+++ b/.example/net/ghttp/server/controller/view.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/frame/gmvc"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/frame/gmvc"
)
type Controller struct {
diff --git a/.example/net/ghttp/server/cookie.go b/.example/net/ghttp/server/cookie.go
index 6b424b228..7702456cb 100644
--- a/.example/net/ghttp/server/cookie.go
+++ b/.example/net/ghttp/server/cookie.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/net/ghttp/server/cors/cors1.go b/.example/net/ghttp/server/cors/cors1.go
index afa7c9b8f..03c50b6aa 100644
--- a/.example/net/ghttp/server/cors/cors1.go
+++ b/.example/net/ghttp/server/cors/cors1.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func MiddlewareCORS(r *ghttp.Request) {
@@ -12,7 +12,7 @@ func MiddlewareCORS(r *ghttp.Request) {
}
func Order(r *ghttp.Request) {
- glog.Println("order")
+ glog.Print("order")
r.Response.Write("GET")
}
diff --git a/.example/net/ghttp/server/cors/cors2.go b/.example/net/ghttp/server/cors/cors2.go
index f6b4b95ec..307ab1ddf 100644
--- a/.example/net/ghttp/server/cors/cors2.go
+++ b/.example/net/ghttp/server/cors/cors2.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareCORS(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/cors/cors3.go b/.example/net/ghttp/server/cors/cors3.go
index f9e0e348e..499e75d28 100644
--- a/.example/net/ghttp/server/cors/cors3.go
+++ b/.example/net/ghttp/server/cors/cors3.go
@@ -3,8 +3,8 @@ package main
import (
"net/http"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareCORS(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/denyroutes/denyroutes.go b/.example/net/ghttp/server/denyroutes/denyroutes.go
index 9e001a584..4dc0020f0 100644
--- a/.example/net/ghttp/server/denyroutes/denyroutes.go
+++ b/.example/net/ghttp/server/denyroutes/denyroutes.go
@@ -1,6 +1,6 @@
package main
-import "github.com/gogf/gf/frame/g"
+import "github.com/gogf/gf/v2/frame/g"
func main() {
s := g.Server()
diff --git a/.example/net/ghttp/server/domain.go b/.example/net/ghttp/server/domain.go
index db7b66f00..f43bc4611 100644
--- a/.example/net/ghttp/server/domain.go
+++ b/.example/net/ghttp/server/domain.go
@@ -1,6 +1,6 @@
package main
-import "github.com/gogf/gf/net/ghttp"
+import "github.com/gogf/gf/v2/net/ghttp"
func Hello1(r *ghttp.Request) {
r.Response.Write("127.0.0.1: Hello World1!")
diff --git a/.example/net/ghttp/server/download/download.go b/.example/net/ghttp/server/download/download.go
index c1cfba7d8..cc1ebee35 100644
--- a/.example/net/ghttp/server/download/download.go
+++ b/.example/net/ghttp/server/download/download.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/duplicate/duplicate1.go b/.example/net/ghttp/server/duplicate/duplicate1.go
index 6a16c77d4..65b506465 100644
--- a/.example/net/ghttp/server/duplicate/duplicate1.go
+++ b/.example/net/ghttp/server/duplicate/duplicate1.go
@@ -2,8 +2,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/duplicate/duplicate2.go b/.example/net/ghttp/server/duplicate/duplicate2.go
index 89cafaaca..85bcae9a3 100644
--- a/.example/net/ghttp/server/duplicate/duplicate2.go
+++ b/.example/net/ghttp/server/duplicate/duplicate2.go
@@ -2,8 +2,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/frame/gmvc"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/frame/gmvc"
)
type User struct {
diff --git a/.example/net/ghttp/server/duplicate/duplicate3.go b/.example/net/ghttp/server/duplicate/duplicate3.go
index 862c0601b..e2b870f6c 100644
--- a/.example/net/ghttp/server/duplicate/duplicate3.go
+++ b/.example/net/ghttp/server/duplicate/duplicate3.go
@@ -2,8 +2,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
type Object struct{}
diff --git a/.example/net/ghttp/server/exit.go b/.example/net/ghttp/server/exit.go
index 864a9ddec..c000f3270 100644
--- a/.example/net/ghttp/server/exit.go
+++ b/.example/net/ghttp/server/exit.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
@@ -16,10 +16,10 @@ func main() {
})
s.BindHookHandlerByMap(p, map[string]ghttp.HandlerFunc{
ghttp.HookBeforeServe: func(r *ghttp.Request) {
- glog.To(r.Response.Writer).Println("BeforeServe")
+ glog.To(r.Response.Writer).Print(r.Context(), "BeforeServe")
},
ghttp.HookAfterServe: func(r *ghttp.Request) {
- glog.To(r.Response.Writer).Println("AfterServe")
+ glog.To(r.Response.Writer).Print(r.Context(), "AfterServe")
},
})
s.SetPort(8199)
diff --git a/.example/net/ghttp/server/form/form-client.go b/.example/net/ghttp/server/form/form-client.go
index 0ae72051c..9a7e29bce 100644
--- a/.example/net/ghttp/server/form/form-client.go
+++ b/.example/net/ghttp/server/form/form-client.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/form/form.go b/.example/net/ghttp/server/form/form.go
index b12b99c75..447ea6d78 100644
--- a/.example/net/ghttp/server/form/form.go
+++ b/.example/net/ghttp/server/form/form.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/hello.go b/.example/net/ghttp/server/hello.go
index 4263a0e06..98bb79771 100644
--- a/.example/net/ghttp/server/hello.go
+++ b/.example/net/ghttp/server/hello.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/hooks/cors1.go b/.example/net/ghttp/server/hooks/cors1.go
index b4b1be33c..352bac573 100644
--- a/.example/net/ghttp/server/hooks/cors1.go
+++ b/.example/net/ghttp/server/hooks/cors1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func Order(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/hooks/cors2.go b/.example/net/ghttp/server/hooks/cors2.go
index 71e43e28a..dfa1d170b 100644
--- a/.example/net/ghttp/server/hooks/cors2.go
+++ b/.example/net/ghttp/server/hooks/cors2.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func Order(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/hooks/hooks1.go b/.example/net/ghttp/server/hooks/hooks1.go
index c87922cf5..817a11eca 100644
--- a/.example/net/ghttp/server/hooks/hooks1.go
+++ b/.example/net/ghttp/server/hooks/hooks1.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
@@ -11,10 +11,10 @@ func main() {
p := "/:name/info/{uid}"
s := g.Server()
s.BindHookHandlerByMap(p, map[string]ghttp.HandlerFunc{
- ghttp.HookBeforeServe: func(r *ghttp.Request) { glog.Println(ghttp.HookBeforeServe) },
- ghttp.HookAfterServe: func(r *ghttp.Request) { glog.Println(ghttp.HookAfterServe) },
- ghttp.HookBeforeOutput: func(r *ghttp.Request) { glog.Println(ghttp.HookBeforeOutput) },
- ghttp.HookAfterOutput: func(r *ghttp.Request) { glog.Println(ghttp.HookAfterOutput) },
+ ghttp.HookBeforeServe: func(r *ghttp.Request) { glog.Print(ghttp.HookBeforeServe) },
+ ghttp.HookAfterServe: func(r *ghttp.Request) { glog.Print(ghttp.HookAfterServe) },
+ ghttp.HookBeforeOutput: func(r *ghttp.Request) { glog.Print(ghttp.HookBeforeOutput) },
+ ghttp.HookAfterOutput: func(r *ghttp.Request) { glog.Print(ghttp.HookAfterOutput) },
})
s.BindHandler(p, func(r *ghttp.Request) {
r.Response.Write("用户:", r.Get("name"), ", uid:", r.Get("uid"))
diff --git a/.example/net/ghttp/server/hooks/hooks4.go b/.example/net/ghttp/server/hooks/hooks4.go
index 3a44c8ae4..b13b8de69 100644
--- a/.example/net/ghttp/server/hooks/hooks4.go
+++ b/.example/net/ghttp/server/hooks/hooks4.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/hooks/hooks5.go b/.example/net/ghttp/server/hooks/hooks5.go
index d7af76007..c61a6b167 100644
--- a/.example/net/ghttp/server/hooks/hooks5.go
+++ b/.example/net/ghttp/server/hooks/hooks5.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/hooks/hooks_param.go b/.example/net/ghttp/server/hooks/hooks_param.go
index 6f6d698d7..2670e276a 100644
--- a/.example/net/ghttp/server/hooks/hooks_param.go
+++ b/.example/net/ghttp/server/hooks/hooks_param.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/hooks/same_route_multi_hook.go b/.example/net/ghttp/server/hooks/same_route_multi_hook.go
index 605b31a03..bd448bcb2 100644
--- a/.example/net/ghttp/server/hooks/same_route_multi_hook.go
+++ b/.example/net/ghttp/server/hooks/same_route_multi_hook.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/https/https.go b/.example/net/ghttp/server/https/https.go
index 3c2da3cec..5ccb9ab49 100644
--- a/.example/net/ghttp/server/https/https.go
+++ b/.example/net/ghttp/server/https/https.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/https/https_http.go b/.example/net/ghttp/server/https/https_http.go
index ad53a0fda..dc5c3ff0e 100644
--- a/.example/net/ghttp/server/https/https_http.go
+++ b/.example/net/ghttp/server/https/https_http.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/log/log.go b/.example/net/ghttp/server/log/log.go
index c4f1958d1..613a2c881 100644
--- a/.example/net/ghttp/server/log/log.go
+++ b/.example/net/ghttp/server/log/log.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
"net/http"
)
diff --git a/.example/net/ghttp/server/log/log_error.go b/.example/net/ghttp/server/log/log_error.go
index 6b8bc48a4..727592f21 100644
--- a/.example/net/ghttp/server/log/log_error.go
+++ b/.example/net/ghttp/server/log/log_error.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/middleware/auth.go b/.example/net/ghttp/server/middleware/auth.go
index cda744673..d4d4efdfd 100644
--- a/.example/net/ghttp/server/middleware/auth.go
+++ b/.example/net/ghttp/server/middleware/auth.go
@@ -3,8 +3,8 @@ package main
import (
"net/http"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareAuth(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/middleware/auth_exception.go b/.example/net/ghttp/server/middleware/auth_exception.go
index f36bbe337..2dbfbcc4f 100644
--- a/.example/net/ghttp/server/middleware/auth_exception.go
+++ b/.example/net/ghttp/server/middleware/auth_exception.go
@@ -3,8 +3,8 @@ package main
import (
"net/http"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareAuth(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/middleware/cors.go b/.example/net/ghttp/server/middleware/cors.go
index d7acaf51f..761d7f458 100644
--- a/.example/net/ghttp/server/middleware/cors.go
+++ b/.example/net/ghttp/server/middleware/cors.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareCORS(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/middleware/error_handling.go b/.example/net/ghttp/server/middleware/error_handling.go
index afe4e98a3..9eee48fe3 100644
--- a/.example/net/ghttp/server/middleware/error_handling.go
+++ b/.example/net/ghttp/server/middleware/error_handling.go
@@ -3,8 +3,8 @@ package main
import (
"net/http"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareAuth(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/middleware/issue355.go b/.example/net/ghttp/server/middleware/issue355.go
index 0470c4af4..048530a70 100644
--- a/.example/net/ghttp/server/middleware/issue355.go
+++ b/.example/net/ghttp/server/middleware/issue355.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/middleware/log.go b/.example/net/ghttp/server/middleware/log.go
index 225dc4c8c..09869d7ad 100644
--- a/.example/net/ghttp/server/middleware/log.go
+++ b/.example/net/ghttp/server/middleware/log.go
@@ -3,10 +3,10 @@ package main
import (
"net/http"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/glog"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareAuth(r *ghttp.Request) {
@@ -25,7 +25,7 @@ func MiddlewareCORS(r *ghttp.Request) {
func MiddlewareLog(r *ghttp.Request) {
r.Middleware.Next()
- g.Log().Println(r.Response.Status, r.URL.Path)
+ g.Log().Print(r.Response.Status, r.URL.Path)
}
func main() {
diff --git a/.example/net/ghttp/server/middleware/middleware.go b/.example/net/ghttp/server/middleware/middleware.go
index 4dcf2ddb9..7ebad3f37 100644
--- a/.example/net/ghttp/server/middleware/middleware.go
+++ b/.example/net/ghttp/server/middleware/middleware.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/middleware/param.go b/.example/net/ghttp/server/middleware/param.go
index ece36b755..385db1d96 100644
--- a/.example/net/ghttp/server/middleware/param.go
+++ b/.example/net/ghttp/server/middleware/param.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
// 前置中间件1
diff --git a/.example/net/ghttp/server/name.go b/.example/net/ghttp/server/name.go
index 2e1cd60cc..fc5d5499b 100644
--- a/.example/net/ghttp/server/name.go
+++ b/.example/net/ghttp/server/name.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
type User struct{}
diff --git a/.example/net/ghttp/server/object/user.go b/.example/net/ghttp/server/object/user.go
index 28d76456e..89215b840 100644
--- a/.example/net/ghttp/server/object/user.go
+++ b/.example/net/ghttp/server/object/user.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
type User struct{}
diff --git a/.example/net/ghttp/server/openapi/openapi.go b/.example/net/ghttp/server/openapi/openapi.go
new file mode 100644
index 000000000..1cad75843
--- /dev/null
+++ b/.example/net/ghttp/server/openapi/openapi.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "context"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+)
+
+type HelloReq struct {
+ g.Meta `path:"/hello" tags:"Test" method:"get" description:"Hello world handler for test"`
+ Content string `json:"content" in:"query"`
+}
+
+type HelloRes struct {
+ Content string `json:"content" description:"Hello response content for test"`
+}
+
+// Hello is an example handler.
+func Hello(ctx context.Context, req *HelloReq) (res *HelloRes, err error) {
+ return &HelloRes{Content: req.Content}, nil
+}
+
+func main() {
+ s := g.Server()
+ s.Use(
+ ghttp.MiddlewareHandlerResponse,
+ )
+ s.BindHandler("/hello", Hello)
+ s.SetOpenApiPath("/api.json")
+ s.SetSwaggerPath("/swagger")
+ s.SetPort(8199)
+ s.Run()
+}
diff --git a/.example/net/ghttp/server/ports.go b/.example/net/ghttp/server/ports.go
index fa6b8c883..dfb187c66 100644
--- a/.example/net/ghttp/server/ports.go
+++ b/.example/net/ghttp/server/ports.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/pprof.go b/.example/net/ghttp/server/pprof.go
index 79f96ebdc..800f098f0 100644
--- a/.example/net/ghttp/server/pprof.go
+++ b/.example/net/ghttp/server/pprof.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/redirect/redirect_back.go b/.example/net/ghttp/server/redirect/redirect_back.go
index ea26283e8..2e2f93e15 100644
--- a/.example/net/ghttp/server/redirect/redirect_back.go
+++ b/.example/net/ghttp/server/redirect/redirect_back.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/redirect/redirect_to.go b/.example/net/ghttp/server/redirect/redirect_to.go
index f7b8f859d..b67b5a3c6 100644
--- a/.example/net/ghttp/server/redirect/redirect_to.go
+++ b/.example/net/ghttp/server/redirect/redirect_to.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/reload/admin.go b/.example/net/ghttp/server/reload/admin.go
index a4147ccc8..eff842a5a 100644
--- a/.example/net/ghttp/server/reload/admin.go
+++ b/.example/net/ghttp/server/reload/admin.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/net/ghttp/server/reload/https.go b/.example/net/ghttp/server/reload/https.go
index fa0a50cfd..ace087ee6 100644
--- a/.example/net/ghttp/server/reload/https.go
+++ b/.example/net/ghttp/server/reload/https.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/reload/https_http.go b/.example/net/ghttp/server/reload/https_http.go
index 155c53722..b0e8de1e8 100644
--- a/.example/net/ghttp/server/reload/https_http.go
+++ b/.example/net/ghttp/server/reload/https_http.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/reload/multi_port_and_server.go b/.example/net/ghttp/server/reload/multi_port_and_server.go
index f599d0d4d..e6c4b5233 100644
--- a/.example/net/ghttp/server/reload/multi_port_and_server.go
+++ b/.example/net/ghttp/server/reload/multi_port_and_server.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/net/ghttp/server/reload/simple.go b/.example/net/ghttp/server/reload/simple.go
index 056ddd2eb..a5b06250b 100644
--- a/.example/net/ghttp/server/reload/simple.go
+++ b/.example/net/ghttp/server/reload/simple.go
@@ -3,9 +3,9 @@ package main
import (
"time"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gproc"
)
func main() {
diff --git a/.example/net/ghttp/server/request/basic.go b/.example/net/ghttp/server/request/basic.go
index d706b6267..3c4aedf28 100644
--- a/.example/net/ghttp/server/request/basic.go
+++ b/.example/net/ghttp/server/request/basic.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/exit/exit.go b/.example/net/ghttp/server/request/exit/exit.go
index 8c4d96188..57d43e0d2 100644
--- a/.example/net/ghttp/server/request/exit/exit.go
+++ b/.example/net/ghttp/server/request/exit/exit.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/json-xml/test1.go b/.example/net/ghttp/server/request/json-xml/test1.go
index ace00f388..aabe06e5a 100644
--- a/.example/net/ghttp/server/request/json-xml/test1.go
+++ b/.example/net/ghttp/server/request/json-xml/test1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/json-xml/test2.go b/.example/net/ghttp/server/request/json-xml/test2.go
index ced00e20d..21b8de109 100644
--- a/.example/net/ghttp/server/request/json-xml/test2.go
+++ b/.example/net/ghttp/server/request/json-xml/test2.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/util/gvalid"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/util/gvalid"
)
type RegisterReq struct {
diff --git a/.example/net/ghttp/server/request/params/array.go b/.example/net/ghttp/server/request/params/array.go
index ab177bffe..36ba6055f 100644
--- a/.example/net/ghttp/server/request/params/array.go
+++ b/.example/net/ghttp/server/request/params/array.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/params/map.go b/.example/net/ghttp/server/request/params/map.go
index 476c665a9..bc913ae33 100644
--- a/.example/net/ghttp/server/request/params/map.go
+++ b/.example/net/ghttp/server/request/params/map.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/params/repeat.go b/.example/net/ghttp/server/request/params/repeat.go
index 1384ac333..ba8f18e63 100644
--- a/.example/net/ghttp/server/request/params/repeat.go
+++ b/.example/net/ghttp/server/request/params/repeat.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/priority.go b/.example/net/ghttp/server/request/priority.go
index 538c77630..93ced6777 100644
--- a/.example/net/ghttp/server/request/priority.go
+++ b/.example/net/ghttp/server/request/priority.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/request_struct.go b/.example/net/ghttp/server/request/request_struct.go
index c2737f6ec..dfc15e349 100644
--- a/.example/net/ghttp/server/request/request_struct.go
+++ b/.example/net/ghttp/server/request/request_struct.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/request_validation.go b/.example/net/ghttp/server/request/request_validation.go
index 2e180ad77..a6ab6185f 100644
--- a/.example/net/ghttp/server/request/request_validation.go
+++ b/.example/net/ghttp/server/request/request_validation.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/util/gvalid"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/util/gvalid"
)
type User struct {
diff --git a/.example/net/ghttp/server/request/struct/parse1.go b/.example/net/ghttp/server/request/struct/parse1.go
index 4018bfa97..f00d79c81 100644
--- a/.example/net/ghttp/server/request/struct/parse1.go
+++ b/.example/net/ghttp/server/request/struct/parse1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/request/struct/parse2.go b/.example/net/ghttp/server/request/struct/parse2.go
index fa72da655..8d5f19786 100644
--- a/.example/net/ghttp/server/request/struct/parse2.go
+++ b/.example/net/ghttp/server/request/struct/parse2.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
type RegisterReq struct {
diff --git a/.example/net/ghttp/server/request/validation/validation1/validation1.go b/.example/net/ghttp/server/request/validation/validation1/validation1.go
index 51a3c8346..759115fa1 100644
--- a/.example/net/ghttp/server/request/validation/validation1/validation1.go
+++ b/.example/net/ghttp/server/request/validation/validation1/validation1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
type RegisterReq struct {
diff --git a/.example/net/ghttp/server/request/validation/validation2/validation2.go b/.example/net/ghttp/server/request/validation/validation2/validation2.go
index 2800feab1..93f5d021f 100644
--- a/.example/net/ghttp/server/request/validation/validation2/validation2.go
+++ b/.example/net/ghttp/server/request/validation/validation2/validation2.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/util/gvalid"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/util/gvalid"
)
type RegisterReq struct {
diff --git a/.example/net/ghttp/server/resource/resource.go b/.example/net/ghttp/server/resource/resource.go
index c9784aeed..c5b63fec9 100644
--- a/.example/net/ghttp/server/resource/resource.go
+++ b/.example/net/ghttp/server/resource/resource.go
@@ -3,10 +3,10 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gres"
- _ "github.com/gogf/gf/os/gres/testdata/data"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gres"
+ _ "github.com/gogf/gf/v2/os/gres/testdata/data"
)
func main() {
diff --git a/.example/net/ghttp/server/reuseport/reuseport.go b/.example/net/ghttp/server/reuseport/reuseport.go
index fe6522da6..a3d3764fa 100644
--- a/.example/net/ghttp/server/reuseport/reuseport.go
+++ b/.example/net/ghttp/server/reuseport/reuseport.go
@@ -1,16 +1,16 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
s1 := ghttp.GetServer("s1")
s1.SetPort(8882)
s1.BindHandler("/", func(r *ghttp.Request) {
- glog.Println("s1")
+ glog.Print(r.Context(), "s1")
r.Response.Writeln("s1")
})
s1.Start()
@@ -18,7 +18,7 @@ func main() {
s2 := ghttp.GetServer("s2")
s2.SetPort(8882)
s2.BindHandler("/", func(r *ghttp.Request) {
- glog.Println("s2")
+ glog.Print(r.Context(), "s2")
r.Response.Writeln("s2")
})
s2.Start()
diff --git a/.example/net/ghttp/server/router/duplicated/duplicated.go b/.example/net/ghttp/server/router/duplicated/duplicated.go
index 9402a2a4d..fb23d03a2 100644
--- a/.example/net/ghttp/server/router/duplicated/duplicated.go
+++ b/.example/net/ghttp/server/router/duplicated/duplicated.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/group/basic.go b/.example/net/ghttp/server/router/group/basic.go
index 899b9243e..bd87d6867 100644
--- a/.example/net/ghttp/server/router/group/basic.go
+++ b/.example/net/ghttp/server/router/group/basic.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/group/batch.go b/.example/net/ghttp/server/router/group/batch.go
index 84519907b..185393e7f 100644
--- a/.example/net/ghttp/server/router/group/batch.go
+++ b/.example/net/ghttp/server/router/group/batch.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
type Object struct{}
diff --git a/.example/net/ghttp/server/router/group/level.go b/.example/net/ghttp/server/router/group/level.go
index 1ee710586..f0563e671 100644
--- a/.example/net/ghttp/server/router/group/level.go
+++ b/.example/net/ghttp/server/router/group/level.go
@@ -3,8 +3,8 @@ package main
import (
"net/http"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func MiddlewareAuth(r *ghttp.Request) {
@@ -23,7 +23,7 @@ func MiddlewareCORS(r *ghttp.Request) {
func MiddlewareLog(r *ghttp.Request) {
r.Middleware.Next()
- g.Log().Println(r.Response.Status, r.URL.Path)
+ g.Log().Print(r.Response.Status, r.URL.Path)
}
func main() {
diff --git a/.example/net/ghttp/server/router/router1.go b/.example/net/ghttp/server/router/router1.go
index 216e805cd..ce2276266 100644
--- a/.example/net/ghttp/server/router/router1.go
+++ b/.example/net/ghttp/server/router/router1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/router2.go b/.example/net/ghttp/server/router/router2.go
index 285817740..3732e8026 100644
--- a/.example/net/ghttp/server/router/router2.go
+++ b/.example/net/ghttp/server/router/router2.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/router3.go b/.example/net/ghttp/server/router/router3.go
index 649694de2..dbf6ba73d 100644
--- a/.example/net/ghttp/server/router/router3.go
+++ b/.example/net/ghttp/server/router/router3.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/router4.go b/.example/net/ghttp/server/router/router4.go
index daa4b9f73..3218be3ea 100644
--- a/.example/net/ghttp/server/router/router4.go
+++ b/.example/net/ghttp/server/router/router4.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/router5.go b/.example/net/ghttp/server/router/router5.go
index c280fadb0..06664e3b5 100644
--- a/.example/net/ghttp/server/router/router5.go
+++ b/.example/net/ghttp/server/router/router5.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/router/router6.go b/.example/net/ghttp/server/router/router6.go
index d22002beb..548acfc5e 100644
--- a/.example/net/ghttp/server/router/router6.go
+++ b/.example/net/ghttp/server/router/router6.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
// 试试模糊匹配规则不带名称会怎么样
diff --git a/.example/net/ghttp/server/servefile/servefile.go b/.example/net/ghttp/server/servefile/servefile.go
index 761cfbe03..85d52b650 100644
--- a/.example/net/ghttp/server/servefile/servefile.go
+++ b/.example/net/ghttp/server/servefile/servefile.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/servefile/servefiledownload.go b/.example/net/ghttp/server/servefile/servefiledownload.go
index a8e734b9b..9c9f67ff5 100644
--- a/.example/net/ghttp/server/servefile/servefiledownload.go
+++ b/.example/net/ghttp/server/servefile/servefiledownload.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/server2.go b/.example/net/ghttp/server/server2.go
index 800dd71f8..fe96ae6bb 100644
--- a/.example/net/ghttp/server/server2.go
+++ b/.example/net/ghttp/server/server2.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/session.go b/.example/net/ghttp/server/session.go
index fd553cff9..704bc8a6d 100644
--- a/.example/net/ghttp/server/session.go
+++ b/.example/net/ghttp/server/session.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/ghttp/server/session/basic/session.go b/.example/net/ghttp/server/session/basic/session.go
index c7a21a684..b2d101845 100644
--- a/.example/net/ghttp/server/session/basic/session.go
+++ b/.example/net/ghttp/server/session/basic/session.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/net/ghttp/server/session/redis/redis.go b/.example/net/ghttp/server/session/redis/redis.go
index 5544c3318..f581dcdcd 100644
--- a/.example/net/ghttp/server/session/redis/redis.go
+++ b/.example/net/ghttp/server/session/redis/redis.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gsession"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gsession"
+ "github.com/gogf/gf/v2/os/gtime"
"time"
)
diff --git a/.example/net/ghttp/server/session/redis/redis_bigint.go b/.example/net/ghttp/server/session/redis/redis_bigint.go
index b8a5b3460..07580bbfd 100644
--- a/.example/net/ghttp/server/session/redis/redis_bigint.go
+++ b/.example/net/ghttp/server/session/redis/redis_bigint.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gsession"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gsession"
)
func main() {
diff --git a/.example/net/ghttp/server/static/static.go b/.example/net/ghttp/server/static/static.go
index 3fbc63809..2a06b196d 100644
--- a/.example/net/ghttp/server/static/static.go
+++ b/.example/net/ghttp/server/static/static.go
@@ -1,6 +1,6 @@
package main
-import "github.com/gogf/gf/frame/g"
+import "github.com/gogf/gf/v2/frame/g"
// 静态文件服务器基本使用
func main() {
diff --git a/.example/net/ghttp/server/static/static_path.go b/.example/net/ghttp/server/static/static_path.go
index 222c6be87..30579ec53 100644
--- a/.example/net/ghttp/server/static/static_path.go
+++ b/.example/net/ghttp/server/static/static_path.go
@@ -1,6 +1,6 @@
package main
-import "github.com/gogf/gf/frame/g"
+import "github.com/gogf/gf/v2/frame/g"
// 静态文件服务器,支持自定义静态目录映射
func main() {
diff --git a/.example/net/ghttp/server/static/static_path2.go b/.example/net/ghttp/server/static/static_path2.go
index f626c99d5..30c5c3258 100644
--- a/.example/net/ghttp/server/static/static_path2.go
+++ b/.example/net/ghttp/server/static/static_path2.go
@@ -1,6 +1,6 @@
package main
-import "github.com/gogf/gf/frame/g"
+import "github.com/gogf/gf/v2/frame/g"
// 静态文件服务器,支持自定义静态目录映射
func main() {
diff --git a/.example/net/ghttp/server/status.go b/.example/net/ghttp/server/status.go
index 34256f0c5..c06feca06 100644
--- a/.example/net/ghttp/server/status.go
+++ b/.example/net/ghttp/server/status.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/status_map.go b/.example/net/ghttp/server/status_map.go
index de0f8b1ca..517af3fc8 100644
--- a/.example/net/ghttp/server/status_map.go
+++ b/.example/net/ghttp/server/status_map.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/status_redirect.go b/.example/net/ghttp/server/status_redirect.go
index e525151a3..5658a3109 100644
--- a/.example/net/ghttp/server/status_redirect.go
+++ b/.example/net/ghttp/server/status_redirect.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/template/build-in/objects/objects.go b/.example/net/ghttp/server/template/build-in/objects/objects.go
index 2559da767..69d1311e5 100644
--- a/.example/net/ghttp/server/template/build-in/objects/objects.go
+++ b/.example/net/ghttp/server/template/build-in/objects/objects.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/template/build-in/vars/vars.go b/.example/net/ghttp/server/template/build-in/vars/vars.go
index 2e9b37027..0d6544202 100644
--- a/.example/net/ghttp/server/template/build-in/vars/vars.go
+++ b/.example/net/ghttp/server/template/build-in/vars/vars.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/template/config/config.go b/.example/net/ghttp/server/template/config/config.go
index f09b8f9ae..94eaa48d6 100644
--- a/.example/net/ghttp/server/template/config/config.go
+++ b/.example/net/ghttp/server/template/config/config.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/template/conflicts-name/client.go b/.example/net/ghttp/server/template/conflicts-name/client.go
index 48786e7a8..c82e35f1a 100644
--- a/.example/net/ghttp/server/template/conflicts-name/client.go
+++ b/.example/net/ghttp/server/template/conflicts-name/client.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
// https://github.com/gogf/gf/issues/437
diff --git a/.example/net/ghttp/server/template/layout/main.go b/.example/net/ghttp/server/template/layout/main.go
index 439589e4b..9040ced33 100644
--- a/.example/net/ghttp/server/template/layout/main.go
+++ b/.example/net/ghttp/server/template/layout/main.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/template/tpl1/tpl1.go b/.example/net/ghttp/server/template/tpl1/tpl1.go
index d10af71b9..da6d18b0e 100644
--- a/.example/net/ghttp/server/template/tpl1/tpl1.go
+++ b/.example/net/ghttp/server/template/tpl1/tpl1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/template/tpl2/main.go b/.example/net/ghttp/server/template/tpl2/main.go
index c933cb678..8489511eb 100644
--- a/.example/net/ghttp/server/template/tpl2/main.go
+++ b/.example/net/ghttp/server/template/tpl2/main.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/frame/gins"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/frame/gins"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/net/ghttp/server/websocket/echo-wss/main.go b/.example/net/ghttp/server/websocket/echo-wss/main.go
index 07d312d71..32689e893 100644
--- a/.example/net/ghttp/server/websocket/echo-wss/main.go
+++ b/.example/net/ghttp/server/websocket/echo-wss/main.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/net/ghttp/server/websocket/echo/main-group.go b/.example/net/ghttp/server/websocket/echo/main-group.go
index fd7acd90e..5a6cd8285 100644
--- a/.example/net/ghttp/server/websocket/echo/main-group.go
+++ b/.example/net/ghttp/server/websocket/echo/main-group.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/os/glog"
)
func ws(r *ghttp.Request) {
diff --git a/.example/net/ghttp/server/websocket/echo/main.go b/.example/net/ghttp/server/websocket/echo/main.go
index daa3f419c..61e45cebb 100644
--- a/.example/net/ghttp/server/websocket/echo/main.go
+++ b/.example/net/ghttp/server/websocket/echo/main.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/net/gsmtp/gsmtp_sendMail.go b/.example/net/gsmtp/gsmtp_sendMail.go
index f32cd7f38..307dbe24f 100644
--- a/.example/net/gsmtp/gsmtp_sendMail.go
+++ b/.example/net/gsmtp/gsmtp_sendMail.go
@@ -8,7 +8,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/gsmtp"
+ "github.com/gogf/gf/v2/net/gsmtp"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_conn.go b/.example/net/gtcp/gtcp_conn.go
index 323595751..855c10901 100644
--- a/.example/net/gtcp/gtcp_conn.go
+++ b/.example/net/gtcp/gtcp_conn.go
@@ -5,8 +5,8 @@ import (
"fmt"
"os"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_echo_server.go b/.example/net/gtcp/gtcp_echo_server.go
index 5f3d481e9..85f60832c 100644
--- a/.example/net/gtcp/gtcp_echo_server.go
+++ b/.example/net/gtcp/gtcp_echo_server.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/gtcp"
+ "github.com/gogf/gf/v2/net/gtcp"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_func.go b/.example/net/gtcp/gtcp_func.go
index bca7df226..79217a973 100644
--- a/.example/net/gtcp/gtcp_func.go
+++ b/.example/net/gtcp/gtcp_func.go
@@ -4,7 +4,7 @@ import (
"fmt"
"os"
- "github.com/gogf/gf/net/gtcp"
+ "github.com/gogf/gf/v2/net/gtcp"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_pool1.go b/.example/net/gtcp/gtcp_pool1.go
index 69c2a491a..200d5e5dd 100644
--- a/.example/net/gtcp/gtcp_pool1.go
+++ b/.example/net/gtcp/gtcp_pool1.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_pool2.go b/.example/net/gtcp/gtcp_pool2.go
index c30ad647d..3032ebfa9 100644
--- a/.example/net/gtcp/gtcp_pool2.go
+++ b/.example/net/gtcp/gtcp_pool2.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_server_client1.go b/.example/net/gtcp/gtcp_server_client1.go
index 8f153aa31..076d455d6 100644
--- a/.example/net/gtcp/gtcp_server_client1.go
+++ b/.example/net/gtcp/gtcp_server_client1.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_server_client2.go b/.example/net/gtcp/gtcp_server_client2.go
index 0c89832dc..5ff8fc79d 100644
--- a/.example/net/gtcp/gtcp_server_client2.go
+++ b/.example/net/gtcp/gtcp_server_client2.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_timeout_client.go b/.example/net/gtcp/gtcp_timeout_client.go
index e4a777282..b3777f72f 100644
--- a/.example/net/gtcp/gtcp_timeout_client.go
+++ b/.example/net/gtcp/gtcp_timeout_client.go
@@ -3,9 +3,9 @@ package main
import (
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/net/gtcp/gtcp_timeout_server.go b/.example/net/gtcp/gtcp_timeout_server.go
index eee3a748c..69c8592da 100644
--- a/.example/net/gtcp/gtcp_timeout_server.go
+++ b/.example/net/gtcp/gtcp_timeout_server.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
+ "github.com/gogf/gf/v2/net/gtcp"
)
func main() {
diff --git a/.example/net/gtcp/pkg_operations/common/funcs/funcs.go b/.example/net/gtcp/pkg_operations/common/funcs/funcs.go
index 368874c1e..dfa2eb883 100644
--- a/.example/net/gtcp/pkg_operations/common/funcs/funcs.go
+++ b/.example/net/gtcp/pkg_operations/common/funcs/funcs.go
@@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/common/types"
- "github.com/gogf/gf/net/gtcp"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/common/types"
+ "github.com/gogf/gf/v2/net/gtcp"
)
// 自定义格式发送消息包
diff --git a/.example/net/gtcp/pkg_operations/common/gtcp_common_client.go b/.example/net/gtcp/pkg_operations/common/gtcp_common_client.go
index 5d4c5f5c1..160878d39 100644
--- a/.example/net/gtcp/pkg_operations/common/gtcp_common_client.go
+++ b/.example/net/gtcp/pkg_operations/common/gtcp_common_client.go
@@ -3,11 +3,11 @@ package main
import (
"time"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/common/funcs"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/common/types"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/common/funcs"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/common/types"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
@@ -32,7 +32,7 @@ func main() {
msg, err := funcs.RecvPkg(conn)
if err != nil {
if err.Error() == "EOF" {
- glog.Println("server closed")
+ glog.Print("server closed")
}
break
}
diff --git a/.example/net/gtcp/pkg_operations/common/gtcp_common_server.go b/.example/net/gtcp/pkg_operations/common/gtcp_common_server.go
index e9a8d4a74..b335db92e 100644
--- a/.example/net/gtcp/pkg_operations/common/gtcp_common_server.go
+++ b/.example/net/gtcp/pkg_operations/common/gtcp_common_server.go
@@ -3,11 +3,11 @@ package main
import (
"time"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/common/funcs"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/common/types"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/common/funcs"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/common/types"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
@@ -21,7 +21,7 @@ func main() {
msg, err := funcs.RecvPkg(conn)
if err != nil {
if err.Error() == "EOF" {
- glog.Println("client closed")
+ glog.Print("client closed")
}
break
}
diff --git a/.example/net/gtcp/pkg_operations/gtcp_basic.go b/.example/net/gtcp/pkg_operations/gtcp_basic.go
index 8927f0586..88c314b50 100644
--- a/.example/net/gtcp/pkg_operations/gtcp_basic.go
+++ b/.example/net/gtcp/pkg_operations/gtcp_basic.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/gtcp/pkg_operations/gtcp_empty_data.go b/.example/net/gtcp/pkg_operations/gtcp_empty_data.go
index d525ae23a..ba20cbad6 100644
--- a/.example/net/gtcp/pkg_operations/gtcp_empty_data.go
+++ b/.example/net/gtcp/pkg_operations/gtcp_empty_data.go
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/net/gtcp/pkg_operations/gtcp_pkg_option.go b/.example/net/gtcp/pkg_operations/gtcp_pkg_option.go
index 2a2d7dccf..41c6ba20b 100644
--- a/.example/net/gtcp/pkg_operations/gtcp_pkg_option.go
+++ b/.example/net/gtcp/pkg_operations/gtcp_pkg_option.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_client.go b/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_client.go
index 7ce623e40..6f150f410 100644
--- a/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_client.go
+++ b/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_client.go
@@ -3,11 +3,11 @@ package main
import (
"encoding/json"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/monitor/types"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/monitor/types"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
@@ -35,9 +35,9 @@ func main() {
// 使用 SendRecvPkg 发送消息包并接受返回
if result, err := conn.SendRecvPkg(info); err != nil {
if err.Error() == "EOF" {
- glog.Println("server closed")
+ glog.Print("server closed")
}
} else {
- glog.Println(string(result))
+ glog.Print(string(result))
}
}
diff --git a/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_server.go b/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_server.go
index b9758f893..056c0a498 100644
--- a/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_server.go
+++ b/.example/net/gtcp/pkg_operations/monitor/gtcp_monitor_server.go
@@ -3,9 +3,9 @@ package main
import (
"encoding/json"
- "github.com/gogf/gf/.example/net/gtcp/pkg_operations/monitor/types"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/.example/net/gtcp/pkg_operations/monitor/types"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
@@ -16,7 +16,7 @@ func main() {
data, err := conn.RecvPkg()
if err != nil {
if err.Error() == "EOF" {
- glog.Println("client closed")
+ glog.Print("client closed")
}
break
}
@@ -24,7 +24,7 @@ func main() {
if err := json.Unmarshal(data, info); err != nil {
glog.Errorf("invalid package structure: %s", err.Error())
} else {
- glog.Println(info)
+ glog.Print(info)
conn.SendPkg([]byte("ok"))
}
}
diff --git a/.example/net/gtcp/pkg_operations/monitor/types/types.go b/.example/net/gtcp/pkg_operations/monitor/types/types.go
index d0c43ed09..2d6b6b7cf 100644
--- a/.example/net/gtcp/pkg_operations/monitor/types/types.go
+++ b/.example/net/gtcp/pkg_operations/monitor/types/types.go
@@ -1,6 +1,6 @@
package types
-import "github.com/gogf/gf/frame/g"
+import "github.com/gogf/gf/v2/frame/g"
type NodeInfo struct {
Cpu float32 // CPU百分比(%)
diff --git a/.example/net/gtcp/server_client/gtcp_client.go b/.example/net/gtcp/server_client/gtcp_client.go
index a991cad7a..be580a6ef 100644
--- a/.example/net/gtcp/server_client/gtcp_client.go
+++ b/.example/net/gtcp/server_client/gtcp_client.go
@@ -3,9 +3,9 @@ package main
import (
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/gtcp/server_client/gtcp_server.go b/.example/net/gtcp/server_client/gtcp_server.go
index e814f31e8..92df614f7 100644
--- a/.example/net/gtcp/server_client/gtcp_server.go
+++ b/.example/net/gtcp/server_client/gtcp_server.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/gtcp"
+ "github.com/gogf/gf/v2/net/gtcp"
)
func main() {
diff --git a/.example/net/gtcp/tls/gtcp_server_client.go b/.example/net/gtcp/tls/gtcp_server_client.go
index e478620cc..87d5bb981 100644
--- a/.example/net/gtcp/tls/gtcp_server_client.go
+++ b/.example/net/gtcp/tls/gtcp_server_client.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gtcp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/net/gtcp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/net/gudp/gudp_server.go b/.example/net/gudp/gudp_server.go
index b3d739798..ba59eaf75 100644
--- a/.example/net/gudp/gudp_server.go
+++ b/.example/net/gudp/gudp_server.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/net/gudp"
+ "github.com/gogf/gf/v2/net/gudp"
)
func main() {
diff --git a/.example/net/gudp/gudp_server_client.go b/.example/net/gudp/gudp_server_client.go
index 720e1052e..a19512ee0 100644
--- a/.example/net/gudp/gudp_server_client.go
+++ b/.example/net/gudp/gudp_server_client.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/net/gudp"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/net/gudp"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gbuild/gbuild.go b/.example/os/gbuild/gbuild.go
index 486371b31..5759c3d18 100644
--- a/.example/os/gbuild/gbuild.go
+++ b/.example/os/gbuild/gbuild.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gbuild"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gbuild"
)
func main() {
diff --git a/.example/os/gcache/getorset_func_lock.go b/.example/os/gcache/getorset_func_lock.go
index b5e3760bc..1d909597d 100644
--- a/.example/os/gcache/getorset_func_lock.go
+++ b/.example/os/gcache/getorset_func_lock.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gcache"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gcache"
+ "github.com/gogf/gf/v2/os/gctx"
"time"
)
diff --git a/.example/os/gcache/note_interface_key.go b/.example/os/gcache/note_interface_key.go
index 4f5e1ee44..08733d7ec 100644
--- a/.example/os/gcache/note_interface_key.go
+++ b/.example/os/gcache/note_interface_key.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gcache"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gcache"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/os/gcache/note_interface_value.go b/.example/os/gcache/note_interface_value.go
index b102e86f0..1d121c9ab 100644
--- a/.example/os/gcache/note_interface_value.go
+++ b/.example/os/gcache/note_interface_value.go
@@ -2,8 +2,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gcache"
- "github.com/gogf/gf/os/gctx"
+ "github.com/gogf/gf/v2/os/gcache"
+ "github.com/gogf/gf/v2/os/gctx"
)
func main() {
diff --git a/.example/os/gcache/usage_basic.go b/.example/os/gcache/usage_basic.go
index a60450689..cc1fa632e 100644
--- a/.example/os/gcache/usage_basic.go
+++ b/.example/os/gcache/usage_basic.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gcache"
+ "github.com/gogf/gf/v2/os/gcache"
)
func main() {
diff --git a/.example/os/gcache/usage_lru.go b/.example/os/gcache/usage_lru.go
index 7671c311d..bbf897530 100644
--- a/.example/os/gcache/usage_lru.go
+++ b/.example/os/gcache/usage_lru.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gcache"
+ "github.com/gogf/gf/v2/os/gcache"
)
func main() {
diff --git a/.example/os/gcache/usage_senior.go b/.example/os/gcache/usage_senior.go
index b82a48344..ac5b4f113 100644
--- a/.example/os/gcache/usage_senior.go
+++ b/.example/os/gcache/usage_senior.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gcache"
+ "github.com/gogf/gf/v2/os/gcache"
)
func main() {
diff --git a/.example/os/gcfg/basic/gcfg1.go b/.example/os/gcfg/basic/gcfg1.go
index 722793aba..2665ebbba 100644
--- a/.example/os/gcfg/basic/gcfg1.go
+++ b/.example/os/gcfg/basic/gcfg1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
// 使用第二个参数指定读取的配置文件
diff --git a/.example/os/gcfg/basic/gcfg2.go b/.example/os/gcfg/basic/gcfg2.go
index 464deaee7..3ccbe7e12 100644
--- a/.example/os/gcfg/basic/gcfg2.go
+++ b/.example/os/gcfg/basic/gcfg2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
// 使用默认的config.toml配置文件读取配置
diff --git a/.example/os/gcfg/basic/gcfg3.go b/.example/os/gcfg/basic/gcfg3.go
index ebc6c994e..fc95f57c1 100644
--- a/.example/os/gcfg/basic/gcfg3.go
+++ b/.example/os/gcfg/basic/gcfg3.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
// 使用GetVar获取动态变量
diff --git a/.example/os/gcfg/basic/gcfg4.go b/.example/os/gcfg/basic/gcfg4.go
index 321ed03a7..a2af5a2d9 100644
--- a/.example/os/gcfg/basic/gcfg4.go
+++ b/.example/os/gcfg/basic/gcfg4.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
// 使用g.Config方法获取配置管理对象,并指定默认的配置文件名称
diff --git a/.example/os/gcfg/basic/gcfg_auto_update.go b/.example/os/gcfg/basic/gcfg_auto_update.go
index 7dd2e6bff..cd01884d1 100644
--- a/.example/os/gcfg/basic/gcfg_auto_update.go
+++ b/.example/os/gcfg/basic/gcfg_auto_update.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/gtimer"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
// 配置文件热更新示例
diff --git a/.example/os/gcfg/basic/gcfg_error.go b/.example/os/gcfg/basic/gcfg_error.go
index b0bc88f72..2df606679 100644
--- a/.example/os/gcfg/basic/gcfg_error.go
+++ b/.example/os/gcfg/basic/gcfg_error.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gcfg/resource/resource.go b/.example/os/gcfg/resource/resource.go
index 9a9aa3c51..9f646fc3e 100644
--- a/.example/os/gcfg/resource/resource.go
+++ b/.example/os/gcfg/resource/resource.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- _ "github.com/gogf/gf/os/gres/testdata"
+ "github.com/gogf/gf/v2/frame/g"
+ _ "github.com/gogf/gf/v2/os/gres/testdata"
)
func main() {
diff --git a/.example/os/gcmd/main.go b/.example/os/gcmd/main.go
index 3cae98c12..21f1d1a54 100644
--- a/.example/os/gcmd/main.go
+++ b/.example/os/gcmd/main.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gcmd"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gcmd"
)
func main() {
diff --git a/.example/os/gcron/gcron-log.go b/.example/os/gcron/gcron-log.go
index 3a87ec5b9..d77aa1a4b 100644
--- a/.example/os/gcron/gcron-log.go
+++ b/.example/os/gcron/gcron-log.go
@@ -3,14 +3,14 @@ package main
import (
"time"
- "github.com/gogf/gf/os/gcron"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/gcron"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
gcron.SetLogLevel(glog.LEVEL_ALL)
gcron.Add("* * * * * ?", func() {
- glog.Println("test")
+ glog.Print("test")
})
time.Sleep(3 * time.Second)
}
diff --git a/.example/os/gcron/gcron1.go b/.example/os/gcron/gcron1.go
index 4e14cca8f..6b90aec61 100644
--- a/.example/os/gcron/gcron1.go
+++ b/.example/os/gcron/gcron1.go
@@ -3,19 +3,19 @@ package main
import (
"time"
- "github.com/gogf/gf/os/gcron"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/gcron"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
- gcron.Add("0 30 * * * *", func() { glog.Println("Every hour on the half hour") })
- gcron.Add("* * * * * *", func() { glog.Println("Every second, pattern") }, "second-cron")
- gcron.Add("*/5 * * * * *", func() { glog.Println("Every 5 seconds, pattern") })
+ gcron.Add("0 30 * * * *", func() { glog.Print("Every hour on the half hour") })
+ gcron.Add("* * * * * *", func() { glog.Print("Every second, pattern") }, "second-cron")
+ gcron.Add("*/5 * * * * *", func() { glog.Print("Every 5 seconds, pattern") })
- gcron.Add("@hourly", func() { glog.Println("Every hour") })
- gcron.Add("@every 1h30m", func() { glog.Println("Every hour thirty") })
- gcron.Add("@every 1s", func() { glog.Println("Every 1 second") })
- gcron.Add("@every 5s", func() { glog.Println("Every 5 seconds") })
+ gcron.Add("@hourly", func() { glog.Print("Every hour") })
+ gcron.Add("@every 1h30m", func() { glog.Print("Every hour thirty") })
+ gcron.Add("@every 1s", func() { glog.Print("Every 1 second") })
+ gcron.Add("@every 5s", func() { glog.Print("Every 5 seconds") })
time.Sleep(3 * time.Second)
diff --git a/.example/os/gcron/gcron2.go b/.example/os/gcron/gcron2.go
index e5ea85ec9..bc032dba1 100644
--- a/.example/os/gcron/gcron2.go
+++ b/.example/os/gcron/gcron2.go
@@ -3,12 +3,12 @@ package main
import (
"time"
- "github.com/gogf/gf/os/gcron"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/gcron"
+ "github.com/gogf/gf/v2/os/glog"
)
func test() {
- glog.Println(111)
+ glog.Print(111)
}
func main() {
diff --git a/.example/os/gfile/gfile.go b/.example/os/gfile/gfile.go
index f3cc69d74..b84ca4a97 100644
--- a/.example/os/gfile/gfile.go
+++ b/.example/os/gfile/gfile.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/util/gutil"
)
var dirpath1 = "/home/john/Workspace/temp/"
diff --git a/.example/os/gfile/gfile_contents.go b/.example/os/gfile/gfile_contents.go
index f972ee707..cfd8eda7f 100644
--- a/.example/os/gfile/gfile_contents.go
+++ b/.example/os/gfile/gfile_contents.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/os/gfile"
)
func main() {
diff --git a/.example/os/gfile/gfile_scan.go b/.example/os/gfile/gfile_scan.go
index 08120909a..bb032562a 100644
--- a/.example/os/gfile/gfile_scan.go
+++ b/.example/os/gfile/gfile_scan.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/util/gutil"
)
func main() {
diff --git a/.example/os/gfpool/gfpool.go b/.example/os/gfpool/gfpool.go
index 48090606e..dbbae303f 100644
--- a/.example/os/gfpool/gfpool.go
+++ b/.example/os/gfpool/gfpool.go
@@ -5,7 +5,7 @@ import (
"os"
"time"
- "github.com/gogf/gf/os/gfpool"
+ "github.com/gogf/gf/v2/os/gfpool"
)
func main() {
diff --git a/.example/os/gfsnotify/fsnotify.go b/.example/os/gfsnotify/fsnotify.go
index 8b473729f..833732398 100644
--- a/.example/os/gfsnotify/fsnotify.go
+++ b/.example/os/gfsnotify/fsnotify.go
@@ -1,10 +1,11 @@
package main
import (
+ "context"
"log"
"github.com/fsnotify/fsnotify"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
@@ -25,7 +26,7 @@ func main() {
for {
select {
case ev := <-watch.Events:
- glog.Println(ev)
+ glog.Print(context.Background(), ev)
case err := <-watch.Errors:
log.Println("error : ", err)
diff --git a/.example/os/gfsnotify/gfsnotify.go b/.example/os/gfsnotify/gfsnotify.go
index cb5c87dc1..deedea686 100644
--- a/.example/os/gfsnotify/gfsnotify.go
+++ b/.example/os/gfsnotify/gfsnotify.go
@@ -1,15 +1,15 @@
package main
import (
- "github.com/gogf/gf/os/gfsnotify"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/gfsnotify"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
//path := `D:\temp`
path := "/Users/john/Temp"
_, err := gfsnotify.Add(path, func(event *gfsnotify.Event) {
- glog.Println(event)
+ glog.Print(event)
})
if err != nil {
glog.Fatal(err)
diff --git a/.example/os/gfsnotify/gfsnotify_callback.go b/.example/os/gfsnotify/gfsnotify_callback.go
index 897aedda1..f6e864d9e 100644
--- a/.example/os/gfsnotify/gfsnotify_callback.go
+++ b/.example/os/gfsnotify/gfsnotify_callback.go
@@ -3,20 +3,20 @@ package main
import (
"time"
- "github.com/gogf/gf/os/gfsnotify"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/gfsnotify"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
c1, err := gfsnotify.Add("/home/john/temp/log", func(event *gfsnotify.Event) {
- glog.Println("callback1")
+ glog.Print("callback1")
})
if err != nil {
panic(err)
}
c2, err := gfsnotify.Add("/home/john/temp/log", func(event *gfsnotify.Event) {
- glog.Println("callback2")
+ glog.Print("callback2")
})
if err != nil {
panic(err)
@@ -24,12 +24,12 @@ func main() {
// 5秒后移除c1的回调函数注册,仅剩c2
gtimer.SetTimeout(5*time.Second, func() {
gfsnotify.RemoveCallback(c1.Id)
- glog.Println("remove callback c1")
+ glog.Print("remove callback c1")
})
// 10秒后移除c2的回调函数注册,所有的回调都移除,不再有任何打印信息输出
gtimer.SetTimeout(10*time.Second, func() {
gfsnotify.RemoveCallback(c2.Id)
- glog.Println("remove callback c2")
+ glog.Print("remove callback c2")
})
select {}
diff --git a/.example/os/gfsnotify/gfsnotify_callback_folder.go b/.example/os/gfsnotify/gfsnotify_callback_folder.go
index d94514790..a12d70f89 100644
--- a/.example/os/gfsnotify/gfsnotify_callback_folder.go
+++ b/.example/os/gfsnotify/gfsnotify_callback_folder.go
@@ -1,16 +1,20 @@
package main
import (
+ "context"
"time"
- "github.com/gogf/gf/os/gfsnotify"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/gfsnotify"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
+ var (
+ ctx = context.Background()
+ )
callback, err := gfsnotify.Add("/home/john/temp", func(event *gfsnotify.Event) {
- glog.Println("callback")
+ glog.Print(ctx, "callback")
})
if err != nil {
panic(err)
@@ -19,9 +23,9 @@ func main() {
// 在此期间创建文件、目录、修改文件、删除文件
// 20秒后移除回调函数注册,所有的回调都移除,不再有任何打印信息输出
- gtimer.SetTimeout(20*time.Second, func() {
+ gtimer.SetTimeout(ctx, 20*time.Second, func(ctx context.Context) {
gfsnotify.RemoveCallback(callback.Id)
- glog.Println("remove callback")
+ glog.Print(ctx, "remove callback")
})
select {}
diff --git a/.example/os/gfsnotify/gfsnotify_limit.go b/.example/os/gfsnotify/gfsnotify_limit.go
index 600541bf9..33522de5c 100644
--- a/.example/os/gfsnotify/gfsnotify_limit.go
+++ b/.example/os/gfsnotify/gfsnotify_limit.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/os/gfsnotify"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/gfsnotify"
+ "github.com/gogf/gf/v2/os/glog"
)
// 对同一个文件多次Add是否超过系统inotify限制
@@ -10,7 +10,7 @@ func main() {
path := "/Users/john/temp/log"
for i := 0; i < 9999999; i++ {
_, err := gfsnotify.Add(path, func(event *gfsnotify.Event) {
- glog.Println(event)
+ glog.Print(event)
})
if err != nil {
glog.Fatal(err)
diff --git a/.example/os/glog/glog_CtxKeys.go b/.example/os/glog/glog_CtxKeys.go
index 3eb6fcc13..dff0efc78 100644
--- a/.example/os/glog/glog_CtxKeys.go
+++ b/.example/os/glog/glog_CtxKeys.go
@@ -2,7 +2,7 @@ package main
import (
"context"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/glog/glog_SetConfigWithMap.go b/.example/os/glog/glog_SetConfigWithMap.go
index 06361b583..d20e70882 100644
--- a/.example/os/glog/glog_SetConfigWithMap.go
+++ b/.example/os/glog/glog_SetConfigWithMap.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/os/glog/glog_async_chaining.go b/.example/os/glog/glog_async_chaining.go
index a3dda3cd6..e5bd8088a 100644
--- a/.example/os/glog/glog_async_chaining.go
+++ b/.example/os/glog/glog_async_chaining.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"time"
)
diff --git a/.example/os/glog/glog_async_configure.go b/.example/os/glog/glog_async_configure.go
index e9cc86bd6..ed4071e92 100644
--- a/.example/os/glog/glog_async_configure.go
+++ b/.example/os/glog/glog_async_configure.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"time"
)
diff --git a/.example/os/glog/glog_category.go b/.example/os/glog/glog_category.go
index 2be6ee80b..1aa9a7e8f 100644
--- a/.example/os/glog/glog_category.go
+++ b/.example/os/glog/glog_category.go
@@ -1,14 +1,14 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gfile"
)
func main() {
path := "/tmp/glog-cat"
g.Log().SetPath(path)
- g.Log().Stdout(false).Cat("cat1").Cat("cat2").Println("test")
+ g.Log().Stdout(false).Cat("cat1").Cat("cat2").Print("test")
list, err := gfile.ScanDir(path, "*", true)
g.Dump(err)
g.Dump(list)
diff --git a/.example/os/glog/glog_color.go b/.example/os/glog/glog_color.go
index b178db5e0..aa64f1e89 100644
--- a/.example/os/glog/glog_color.go
+++ b/.example/os/glog/glog_color.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/glog/glog_debug.go b/.example/os/glog/glog_debug.go
index 579aefe3b..1129b0f3d 100644
--- a/.example/os/glog/glog_debug.go
+++ b/.example/os/glog/glog_debug.go
@@ -1,11 +1,11 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"time"
- "github.com/gogf/gf/os/gtime"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/gtime"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/os/glog/glog_error.go b/.example/os/glog/glog_error.go
index 3eca662b7..15e811fb7 100644
--- a/.example/os/glog/glog_error.go
+++ b/.example/os/glog/glog_error.go
@@ -1,6 +1,6 @@
package main
-import "github.com/gogf/gf/os/glog"
+import "github.com/gogf/gf/v2/os/glog"
func Test() {
glog.Error("This is error!")
diff --git a/.example/os/glog/glog_file.go b/.example/os/glog/glog_file.go
index 9e4f6b858..6aa1cb7f6 100644
--- a/.example/os/glog/glog_file.go
+++ b/.example/os/glog/glog_file.go
@@ -1,27 +1,32 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gfile"
+ "context"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gfile"
)
// 设置日志等级
func main() {
- path := "/tmp/glog"
+ var (
+ ctx = context.TODO()
+ path = "/tmp/glog"
+ )
+
g.Log().SetPath(path)
g.Log().SetStdoutPrint(false)
// 使用默认文件名称格式
- g.Log().Println("标准文件名称格式,使用当前时间时期")
+ g.Log().Print(ctx, "标准文件名称格式,使用当前时间时期")
// 通过SetFile设置文件名称格式
g.Log().SetFile("stdout.log")
- g.Log().Println("设置日志输出文件名称格式为同一个文件")
+ g.Log().Print(ctx, "设置日志输出文件名称格式为同一个文件")
// 链式操作设置文件名称格式
- g.Log().File("stderr.log").Println("支持链式操作")
- g.Log().File("error-{Ymd}.log").Println("文件名称支持带gtime日期格式")
- g.Log().File("access-{Ymd}.log").Println("文件名称支持带gtime日期格式")
+ g.Log().File("stderr.log").Print(ctx, "支持链式操作")
+ g.Log().File("error-{Ymd}.log").Print(ctx, "文件名称支持带gtime日期格式")
+ g.Log().File("access-{Ymd}.log").Print(ctx, "文件名称支持带gtime日期格式")
list, err := gfile.ScanDir(path, "*")
g.Dump(err)
diff --git a/.example/os/glog/glog_flags.go b/.example/os/glog/glog_flags.go
index f3ed32ce3..3ab7ea82e 100644
--- a/.example/os/glog/glog_flags.go
+++ b/.example/os/glog/glog_flags.go
@@ -1,15 +1,15 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
g.Log().SetFlags(glog.F_TIME_TIME | glog.F_FILE_SHORT)
- g.Log().Println("time and short line number")
+ g.Log().Print("time and short line number")
g.Log().SetFlags(glog.F_TIME_MILLI | glog.F_FILE_LONG)
- g.Log().Println("time with millisecond and long line number")
+ g.Log().Print("time with millisecond and long line number")
g.Log().SetFlags(glog.F_TIME_STD | glog.F_FILE_LONG)
- g.Log().Println("standard time format and long line number")
+ g.Log().Print("standard time format and long line number")
}
diff --git a/.example/os/glog/glog_gerror.go b/.example/os/glog/glog_gerror.go
index 6fb54f726..018a31b08 100644
--- a/.example/os/glog/glog_gerror.go
+++ b/.example/os/glog/glog_gerror.go
@@ -2,9 +2,9 @@ package main
import (
"errors"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/errors/gerror"
+ "github.com/gogf/gf/v2/errors/gerror"
)
func MakeError() error {
diff --git a/.example/os/glog/glog_json.go b/.example/os/glog/glog_json.go
index 1075bf056..e9285d8fe 100644
--- a/.example/os/glog/glog_json.go
+++ b/.example/os/glog/glog_json.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/glog/glog_level.go b/.example/os/glog/glog_level.go
index e8c7b917b..701f1132a 100644
--- a/.example/os/glog/glog_level.go
+++ b/.example/os/glog/glog_level.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/glog"
)
// 设置日志等级,过滤掉Info日志信息
diff --git a/.example/os/glog/glog_level_prefix.go b/.example/os/glog/glog_level_prefix.go
index 014c7c288..c15687866 100644
--- a/.example/os/glog/glog_level_prefix.go
+++ b/.example/os/glog/glog_level_prefix.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/glog"
)
func main() {
diff --git a/.example/os/glog/glog_line.go b/.example/os/glog/glog_line.go
index 5326cf867..2d7648343 100644
--- a/.example/os/glog/glog_line.go
+++ b/.example/os/glog/glog_line.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/glog/glog_line2.go b/.example/os/glog/glog_line2.go
index 9fd8a60fc..ea0011462 100644
--- a/.example/os/glog/glog_line2.go
+++ b/.example/os/glog/glog_line2.go
@@ -1,12 +1,12 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func PrintLog(content string) {
- g.Log().Skip(0).Line().Println("line number with skip:", content)
- g.Log().Line(true).Println("line number without skip:", content)
+ g.Log().Skip(0).Line().Print("line number with skip:", content)
+ g.Log().Line(true).Print("line number without skip:", content)
}
func main() {
diff --git a/.example/os/glog/glog_path.go b/.example/os/glog/glog_path.go
index a7d0e4367..64b40be32 100644
--- a/.example/os/glog/glog_path.go
+++ b/.example/os/glog/glog_path.go
@@ -1,15 +1,15 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gfile"
)
// 设置日志输出路径
func main() {
path := "/tmp/glog"
g.Log().SetPath(path)
- g.Log().Println("日志内容")
+ g.Log().Print("日志内容")
list, err := gfile.ScanDir(path, "*")
g.Dump(err)
g.Dump(list)
diff --git a/.example/os/glog/glog_pool.go b/.example/os/glog/glog_pool.go
index 960e85557..565848e93 100644
--- a/.example/os/glog/glog_pool.go
+++ b/.example/os/glog/glog_pool.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"time"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
// 测试删除日志文件是否会重建日志文件
@@ -12,7 +12,7 @@ func main() {
path := "/Users/john/Temp/test"
g.Log().SetPath(path)
for {
- g.Log().Println(gtime.Now().String())
+ g.Log().Print(gtime.Now().String())
time.Sleep(time.Second)
}
}
diff --git a/.example/os/glog/glog_prefix.go b/.example/os/glog/glog_prefix.go
index b803b9a4e..90c114354 100644
--- a/.example/os/glog/glog_prefix.go
+++ b/.example/os/glog/glog_prefix.go
@@ -1,11 +1,11 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
g.Log().SetPrefix("[API]")
- g.Log().Println("hello world")
+ g.Log().Print("hello world")
g.Log().Error("error occurred")
}
diff --git a/.example/os/glog/glog_stack.go b/.example/os/glog/glog_stack.go
index 1dced6e69..854793408 100644
--- a/.example/os/glog/glog_stack.go
+++ b/.example/os/glog/glog_stack.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/glog/glog_stdout.go b/.example/os/glog/glog_stdout.go
index c4ae4d6ba..801d65732 100644
--- a/.example/os/glog/glog_stdout.go
+++ b/.example/os/glog/glog_stdout.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
"sync"
)
@@ -14,7 +14,7 @@ func main() {
for i := 0; i < 3000; i++ {
go func() {
<-ch
- g.Log().Println("abcdefghijklmnopqrstuvwxyz1234567890")
+ g.Log().Print("abcdefghijklmnopqrstuvwxyz1234567890")
wg.Done()
}()
}
diff --git a/.example/os/glog/glog_writer_greylog.go b/.example/os/glog/glog_writer_greylog.go
index fddf60daf..4f0824a47 100644
--- a/.example/os/glog/glog_writer_greylog.go
+++ b/.example/os/glog/glog_writer_greylog.go
@@ -1,7 +1,7 @@
package main
//import (
-// "github.com/gogf/gf/os/glog"
+// "github.com/gogf/gf/v2/os/glog"
// "github.com/robertkowalski/graylog-golang"
//)
//
@@ -26,5 +26,5 @@ package main
// MaxChunkSizeLan : 1337,
// }),
// })
-// glog.Println("test log")
+// glog.Print("test log")
//}
diff --git a/.example/os/glog/glog_writer_hook.go b/.example/os/glog/glog_writer_hook.go
index 365ec28f0..e3a6e4526 100644
--- a/.example/os/glog/glog_writer_hook.go
+++ b/.example/os/glog/glog_writer_hook.go
@@ -2,10 +2,10 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/text/gregex"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/text/gregex"
)
type MyWriter struct {
diff --git a/.example/os/glog/handler/glog_handler_greylog.go b/.example/os/glog/handler/glog_handler_greylog.go
index e690ac309..295ea11f9 100644
--- a/.example/os/glog/handler/glog_handler_greylog.go
+++ b/.example/os/glog/handler/glog_handler_greylog.go
@@ -2,8 +2,8 @@ package main
//import (
// "context"
-// "github.com/gogf/gf/frame/g"
-// "github.com/gogf/gf/os/glog"
+// "github.com/gogf/gf/v2/frame/g"
+// "github.com/gogf/gf/v2/os/glog"
// "github.com/robertkowalski/graylog-golang"
//)
//
@@ -27,5 +27,5 @@ package main
// g.Log().Debug("Debugging...")
// g.Log().Warning("It is warning info")
// g.Log().Error("Error occurs, please have a check")
-// glog.Println("test log")
+// glog.Print("test log")
//}
diff --git a/.example/os/glog/handler/glog_handler_json.go b/.example/os/glog/handler/glog_handler_json.go
index 49dc0750b..2e53212a8 100644
--- a/.example/os/glog/handler/glog_handler_json.go
+++ b/.example/os/glog/handler/glog_handler_json.go
@@ -2,10 +2,10 @@ package main
import (
"context"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/internal/json"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/text/gstr"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/internal/json"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/text/gstr"
"os"
)
diff --git a/.example/os/gmlock/1.lock&unlock.go b/.example/os/gmlock/1.lock&unlock.go
index 71a4d3534..caaba0916 100644
--- a/.example/os/gmlock/1.lock&unlock.go
+++ b/.example/os/gmlock/1.lock&unlock.go
@@ -4,8 +4,8 @@ import (
"sync"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gmlock"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gmlock"
)
// 内存锁基本使用
@@ -18,7 +18,7 @@ func main() {
wg.Add(1)
go func(i int) {
gmlock.Lock(key)
- glog.Println(i)
+ glog.Print(i)
time.Sleep(time.Second)
gmlock.Unlock(key)
wg.Done()
diff --git a/.example/os/gmlock/2.trylock.go b/.example/os/gmlock/2.trylock.go
index 6eca22f82..7fe2c421c 100644
--- a/.example/os/gmlock/2.trylock.go
+++ b/.example/os/gmlock/2.trylock.go
@@ -4,8 +4,8 @@ import (
"sync"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gmlock"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gmlock"
)
// 内存锁 - TryLock
@@ -16,11 +16,11 @@ func main() {
wg.Add(1)
go func(i int) {
if gmlock.TryLock(key) {
- glog.Println(i)
+ glog.Print(i)
time.Sleep(time.Second)
gmlock.Unlock(key)
} else {
- glog.Println(false)
+ glog.Print(false)
}
wg.Done()
}(i)
diff --git a/.example/os/gmlock/3.lock_conflicts.go b/.example/os/gmlock/3.lock_conflicts.go
index 3f27939c0..712080a4a 100644
--- a/.example/os/gmlock/3.lock_conflicts.go
+++ b/.example/os/gmlock/3.lock_conflicts.go
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gmlock"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gmlock"
)
// 内存锁 - 手动Unlock与计时Unlock冲突校验
@@ -14,26 +14,26 @@ func main() {
// 第一次锁带时间
gmlock.Lock(key)
- glog.Println("lock1")
+ glog.Print("lock1")
// 这个时候上一次的计时解锁已失效
gmlock.Unlock(key)
- glog.Println("unlock1")
+ glog.Print("unlock1")
fmt.Println()
// 第二次锁,不带时间,且在执行过程中钱一个Lock的定时解锁生效
gmlock.Lock(key)
- glog.Println("lock2")
+ glog.Print("lock2")
go func() {
// 正常情况下3秒后才能执行这句
gmlock.Lock(key)
- glog.Println("lock by goroutine")
+ glog.Print("lock by goroutine")
}()
time.Sleep(3 * time.Second)
// 这时再解锁
gmlock.Unlock(key)
// 注意3秒之后才会执行这一句
- glog.Println("unlock2")
+ glog.Print("unlock2")
select {}
}
diff --git a/.example/os/gmlock/4.test_deadlock.go b/.example/os/gmlock/4.test_deadlock.go
index b67cf7ddd..9bc74976f 100644
--- a/.example/os/gmlock/4.test_deadlock.go
+++ b/.example/os/gmlock/4.test_deadlock.go
@@ -6,7 +6,7 @@ import (
"sync"
"time"
- "github.com/gogf/gf/os/gmlock"
+ "github.com/gogf/gf/v2/os/gmlock"
)
// 测试Locker是否会产生死锁
diff --git a/.example/os/gmutex/gmutex_basic.go b/.example/os/gmutex/gmutex_basic.go
index e89bbcd3d..5ca0944fa 100644
--- a/.example/os/gmutex/gmutex_basic.go
+++ b/.example/os/gmutex/gmutex_basic.go
@@ -3,8 +3,8 @@ package main
import (
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gmutex"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gmutex"
)
func main() {
@@ -13,7 +13,7 @@ func main() {
go func(n int) {
mu.Lock()
defer mu.Unlock()
- glog.Println("Lock:", n)
+ glog.Print("Lock:", n)
time.Sleep(time.Second)
}(i)
}
@@ -21,7 +21,7 @@ func main() {
go func(n int) {
mu.RLock()
defer mu.RUnlock()
- glog.Println("RLock:", n)
+ glog.Print("RLock:", n)
time.Sleep(time.Second)
}(i)
}
diff --git a/.example/os/gmutex/gmutex_func.go b/.example/os/gmutex/gmutex_func.go
index b26308736..cc2515883 100644
--- a/.example/os/gmutex/gmutex_func.go
+++ b/.example/os/gmutex/gmutex_func.go
@@ -3,20 +3,20 @@ package main
import (
"time"
- "github.com/gogf/gf/os/glog"
+ "github.com/gogf/gf/v2/os/glog"
- "github.com/gogf/gf/os/gmutex"
+ "github.com/gogf/gf/v2/os/gmutex"
)
func main() {
mu := gmutex.New()
go mu.LockFunc(func() {
- glog.Println("lock func1")
+ glog.Print("lock func1")
time.Sleep(1 * time.Second)
})
time.Sleep(time.Millisecond)
go mu.LockFunc(func() {
- glog.Println("lock func2")
+ glog.Print("lock func2")
})
time.Sleep(2 * time.Second)
}
diff --git a/.example/os/gproc/gproc.go b/.example/os/gproc/gproc.go
index f3629e82c..743f45979 100644
--- a/.example/os/gproc/gproc.go
+++ b/.example/os/gproc/gproc.go
@@ -4,8 +4,8 @@ import (
"os"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gproc"
)
// 父子进程基本演示
diff --git a/.example/os/gproc/gproc3.go b/.example/os/gproc/gproc3.go
index 0d1202227..49acaa0e0 100644
--- a/.example/os/gproc/gproc3.go
+++ b/.example/os/gproc/gproc3.go
@@ -4,8 +4,8 @@ import (
"os"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gproc"
)
// 父进程销毁后,使用进程管理器查看存活的子进程。
diff --git a/.example/os/gproc/gproc4.go b/.example/os/gproc/gproc4.go
index 2b7caeb75..2fd2855fd 100644
--- a/.example/os/gproc/gproc4.go
+++ b/.example/os/gproc/gproc4.go
@@ -4,9 +4,9 @@ import (
"os"
"time"
- "github.com/gogf/gf/os/genv"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/genv"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gproc"
)
// 查看父子进程的环境变量
diff --git a/.example/os/gproc/gproc_comm.go b/.example/os/gproc/gproc_comm.go
index 858cbf4c6..ca95ee290 100644
--- a/.example/os/gproc/gproc_comm.go
+++ b/.example/os/gproc/gproc_comm.go
@@ -5,10 +5,10 @@ import (
"os"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gproc"
- "github.com/gogf/gf/os/gtime"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gproc"
+ "github.com/gogf/gf/v2/os/gtime"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/os/gproc/gproc_comm_group.go b/.example/os/gproc/gproc_comm_group.go
index 13191ed74..90e216944 100644
--- a/.example/os/gproc/gproc_comm_group.go
+++ b/.example/os/gproc/gproc_comm_group.go
@@ -6,8 +6,8 @@ import (
"os"
"time"
- "github.com/gogf/gf/os/gproc"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gproc"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gproc/gproc_comm_send.go b/.example/os/gproc/gproc_comm_send.go
index c29b2cf35..a3f6c92b5 100644
--- a/.example/os/gproc/gproc_comm_send.go
+++ b/.example/os/gproc/gproc_comm_send.go
@@ -4,7 +4,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/gproc"
)
func main() {
diff --git a/.example/os/gproc/gproc_kill.go b/.example/os/gproc/gproc_kill.go
index 978c0deda..cb438e0f3 100644
--- a/.example/os/gproc/gproc_kill.go
+++ b/.example/os/gproc/gproc_kill.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/gproc"
)
func main() {
diff --git a/.example/os/gproc/gproc_shellexec.go b/.example/os/gproc/gproc_shellexec.go
index 7ba255193..ed6600839 100644
--- a/.example/os/gproc/gproc_shellexec.go
+++ b/.example/os/gproc/gproc_shellexec.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/gproc"
)
// 执行shell指令
diff --git a/.example/os/gproc/gproc_sleep.go b/.example/os/gproc/gproc_sleep.go
index 35162ac56..66aaadea2 100644
--- a/.example/os/gproc/gproc_sleep.go
+++ b/.example/os/gproc/gproc_sleep.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/gproc"
)
func main() {
diff --git a/.example/os/gproc/signal/signal_handler_gproc.go b/.example/os/gproc/signal/signal_handler_gproc.go
index e8e473484..06cde3386 100644
--- a/.example/os/gproc/signal/signal_handler_gproc.go
+++ b/.example/os/gproc/signal/signal_handler_gproc.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gproc"
+ "github.com/gogf/gf/v2/os/gproc"
"os"
"time"
)
diff --git a/.example/os/gres/gres_example.go b/.example/os/gres/gres_example.go
index c2d62108c..cf2084107 100644
--- a/.example/os/gres/gres_example.go
+++ b/.example/os/gres/gres_example.go
@@ -1,10 +1,10 @@
package main
import (
- _ "github.com/gogf/gf/os/gres/testdata/example/boot"
+ _ "github.com/gogf/gf/v2/os/gres/testdata/example/boot"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/os/gres/gres_pack.go b/.example/os/gres/gres_pack.go
index d9382c9d3..28c6e237e 100644
--- a/.example/os/gres/gres_pack.go
+++ b/.example/os/gres/gres_pack.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/crypto/gaes"
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/os/gres"
+ "github.com/gogf/gf/v2/crypto/gaes"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/os/gres"
)
var (
diff --git a/.example/os/gres/gres_unpack.go b/.example/os/gres/gres_unpack.go
index 734065052..cec200e3b 100644
--- a/.example/os/gres/gres_unpack.go
+++ b/.example/os/gres/gres_unpack.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/crypto/gaes"
- "github.com/gogf/gf/os/gfile"
- "github.com/gogf/gf/os/gres"
+ "github.com/gogf/gf/v2/crypto/gaes"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/os/gres"
)
var (
diff --git a/.example/os/grpool/goroutine.go b/.example/os/grpool/goroutine.go
index fc97f88e5..2bbcc1468 100644
--- a/.example/os/grpool/goroutine.go
+++ b/.example/os/grpool/goroutine.go
@@ -5,7 +5,7 @@ import (
"sync"
"time"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/grpool/grpool.go b/.example/os/grpool/grpool.go
index e067af081..9e02a0952 100644
--- a/.example/os/grpool/grpool.go
+++ b/.example/os/grpool/grpool.go
@@ -5,8 +5,8 @@ import (
"sync"
"time"
- "github.com/gogf/gf/os/grpool"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/grpool"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/grpool/grpool1.go b/.example/os/grpool/grpool1.go
index 311e6a0de..a71a1d0b2 100644
--- a/.example/os/grpool/grpool1.go
+++ b/.example/os/grpool/grpool1.go
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/grpool"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/grpool"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func job() {
diff --git a/.example/os/grpool/grpool2.go b/.example/os/grpool/grpool2.go
index 1494763f5..4cb3933dc 100644
--- a/.example/os/grpool/grpool2.go
+++ b/.example/os/grpool/grpool2.go
@@ -4,7 +4,7 @@ import (
"fmt"
"sync"
- "github.com/gogf/gf/os/grpool"
+ "github.com/gogf/gf/v2/os/grpool"
)
func main() {
diff --git a/.example/os/grpool/grpool3.go b/.example/os/grpool/grpool3.go
index c7738000a..a91e14641 100644
--- a/.example/os/grpool/grpool3.go
+++ b/.example/os/grpool/grpool3.go
@@ -4,7 +4,7 @@ import (
"fmt"
"sync"
- "github.com/gogf/gf/os/grpool"
+ "github.com/gogf/gf/v2/os/grpool"
)
func main() {
diff --git a/.example/os/grpool/grpool5.go b/.example/os/grpool/grpool5.go
index 7f6b7e2d6..0b9c1aeff 100644
--- a/.example/os/grpool/grpool5.go
+++ b/.example/os/grpool/grpool5.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/grpool"
+ "github.com/gogf/gf/v2/os/grpool"
)
func main() {
diff --git a/.example/os/gsession/storage-file/file.go b/.example/os/gsession/storage-file/file.go
index 83cb57510..513ddf0d3 100644
--- a/.example/os/gsession/storage-file/file.go
+++ b/.example/os/gsession/storage-file/file.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gtime"
"time"
)
diff --git a/.example/os/gsession/storage-memory/memory.go b/.example/os/gsession/storage-memory/memory.go
index 8d956c989..13821122f 100644
--- a/.example/os/gsession/storage-memory/memory.go
+++ b/.example/os/gsession/storage-memory/memory.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gsession"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gsession"
+ "github.com/gogf/gf/v2/os/gtime"
"time"
)
diff --git a/.example/os/gsession/storage-redis-hashtable/redis-hashtable.go b/.example/os/gsession/storage-redis-hashtable/redis-hashtable.go
index 2e35f89ca..4a83c8793 100644
--- a/.example/os/gsession/storage-redis-hashtable/redis-hashtable.go
+++ b/.example/os/gsession/storage-redis-hashtable/redis-hashtable.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gsession"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gsession"
+ "github.com/gogf/gf/v2/os/gtime"
"time"
)
diff --git a/.example/os/gsession/storage-redis/redis.go b/.example/os/gsession/storage-redis/redis.go
index 9dbcc4a4d..5b7068c3e 100644
--- a/.example/os/gsession/storage-redis/redis.go
+++ b/.example/os/gsession/storage-redis/redis.go
@@ -1,10 +1,10 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gsession"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gsession"
+ "github.com/gogf/gf/v2/os/gtime"
"time"
)
diff --git a/.example/os/gspath/gspath.go b/.example/os/gspath/gspath.go
index 494ae5893..8e3eccc5d 100644
--- a/.example/os/gspath/gspath.go
+++ b/.example/os/gspath/gspath.go
@@ -4,9 +4,9 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gspath"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gspath"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_format.go b/.example/os/gtime/gtime_format.go
index 636fd682e..b0bdc9322 100644
--- a/.example/os/gtime/gtime_format.go
+++ b/.example/os/gtime/gtime_format.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_func.go b/.example/os/gtime/gtime_func.go
index a7e75aaeb..d362ac25e 100644
--- a/.example/os/gtime/gtime_func.go
+++ b/.example/os/gtime/gtime_func.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_json.go b/.example/os/gtime/gtime_json.go
index 08770df9e..66209af74 100644
--- a/.example/os/gtime/gtime_json.go
+++ b/.example/os/gtime/gtime_json.go
@@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_layout.go b/.example/os/gtime/gtime_layout.go
index adada9892..a75f0b90d 100644
--- a/.example/os/gtime/gtime_layout.go
+++ b/.example/os/gtime/gtime_layout.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_linkop.go b/.example/os/gtime/gtime_linkop.go
index 33323cfdf..d708bffc9 100644
--- a/.example/os/gtime/gtime_linkop.go
+++ b/.example/os/gtime/gtime_linkop.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_parsertime.go b/.example/os/gtime/gtime_parsertime.go
index 6f928f34c..740df565b 100644
--- a/.example/os/gtime/gtime_parsertime.go
+++ b/.example/os/gtime/gtime_parsertime.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_regex1.go b/.example/os/gtime/gtime_regex1.go
index 0f7bfe48f..4f0826af9 100644
--- a/.example/os/gtime/gtime_regex1.go
+++ b/.example/os/gtime/gtime_regex1.go
@@ -4,7 +4,7 @@ import (
"fmt"
"regexp"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_regex2.go b/.example/os/gtime/gtime_regex2.go
index 434aaa306..99c07859e 100644
--- a/.example/os/gtime/gtime_regex2.go
+++ b/.example/os/gtime/gtime_regex2.go
@@ -4,7 +4,7 @@ import (
"fmt"
"regexp"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_strtotime.go b/.example/os/gtime/gtime_strtotime.go
index 3f73a4159..4169e66f2 100644
--- a/.example/os/gtime/gtime_strtotime.go
+++ b/.example/os/gtime/gtime_strtotime.go
@@ -1,11 +1,12 @@
package main
import (
+ "context"
"fmt"
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
@@ -38,7 +39,7 @@ func main() {
fmt.Println(t.UTC().String())
fmt.Println(t.In(cstLocal).String())
} else {
- glog.Error(s, err)
+ glog.Error(context.Background(), s, err)
}
fmt.Println()
}
diff --git a/.example/os/gtime/gtime_strtotime2.go b/.example/os/gtime/gtime_strtotime2.go
index df05d10fb..7b3e0e86f 100644
--- a/.example/os/gtime/gtime_strtotime2.go
+++ b/.example/os/gtime/gtime_strtotime2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtime/gtime_zone.go b/.example/os/gtime/gtime_zone.go
index 11fe03f99..e34c5f988 100644
--- a/.example/os/gtime/gtime_zone.go
+++ b/.example/os/gtime/gtime_zone.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gtimer/gtimer-batch.go b/.example/os/gtimer/gtimer-batch.go
index 4152ba7f8..cbc902ef8 100644
--- a/.example/os/gtimer/gtimer-batch.go
+++ b/.example/os/gtimer/gtimer-batch.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/os/gtimer/gtimer1.go b/.example/os/gtimer/gtimer1.go
index 9a4a63e3b..1f965f6ea 100644
--- a/.example/os/gtimer/gtimer1.go
+++ b/.example/os/gtimer/gtimer1.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/os/gtimer/gtimer2.go b/.example/os/gtimer/gtimer2.go
index 8429a16b7..3844e6bd5 100644
--- a/.example/os/gtimer/gtimer2.go
+++ b/.example/os/gtimer/gtimer2.go
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/container/gtype"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/container/gtype"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
diff --git a/.example/os/gtimer/gtimer3.go b/.example/os/gtimer/gtimer3.go
index 6cf16e3d0..aa726c704 100644
--- a/.example/os/gtimer/gtimer3.go
+++ b/.example/os/gtimer/gtimer3.go
@@ -3,14 +3,14 @@ package main
import (
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
interval := time.Second
gtimer.AddSingleton(interval, func() {
- glog.Println("doing")
+ glog.Print("doing")
time.Sleep(5 * time.Second)
})
diff --git a/.example/os/gtimer/gtimer4.go b/.example/os/gtimer/gtimer4.go
index 8d9cc6491..88dea15bf 100644
--- a/.example/os/gtimer/gtimer4.go
+++ b/.example/os/gtimer/gtimer4.go
@@ -3,17 +3,17 @@ package main
import (
"time"
- "github.com/gogf/gf/os/glog"
- "github.com/gogf/gf/os/gtimer"
+ "github.com/gogf/gf/v2/os/glog"
+ "github.com/gogf/gf/v2/os/gtimer"
)
func main() {
interval := time.Second
gtimer.AddTimes(interval, 2, func() {
- glog.Println("doing1")
+ glog.Print("doing1")
})
gtimer.AddTimes(interval, 2, func() {
- glog.Println("doing2")
+ glog.Print("doing2")
})
select {}
diff --git a/.example/os/gview/assign/assign.go b/.example/os/gview/assign/assign.go
index 1f64a5b6c..af0389af6 100644
--- a/.example/os/gview/assign/assign.go
+++ b/.example/os/gview/assign/assign.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gview"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gview"
)
func main() {
diff --git a/.example/os/gview/basic/gview.go b/.example/os/gview/basic/gview.go
index d4e15ea40..53b31222c 100644
--- a/.example/os/gview/basic/gview.go
+++ b/.example/os/gview/basic/gview.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/bind_func/gview_func1.go b/.example/os/gview/bind_func/gview_func1.go
index fa6f3c873..bbbe8cb33 100644
--- a/.example/os/gview/bind_func/gview_func1.go
+++ b/.example/os/gview/bind_func/gview_func1.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gview"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gview"
)
// 用于测试的内置函数
diff --git a/.example/os/gview/bind_func/gview_func2.go b/.example/os/gview/bind_func/gview_func2.go
index 3ecda6c20..ca711b6a3 100644
--- a/.example/os/gview/bind_func/gview_func2.go
+++ b/.example/os/gview/bind_func/gview_func2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
// 用于测试的带参数的内置函数
diff --git a/.example/os/gview/build_in_funcs/build_in_funcs1.go b/.example/os/gview/build_in_funcs/build_in_funcs1.go
index 7fdb59f5c..3f365ec83 100644
--- a/.example/os/gview/build_in_funcs/build_in_funcs1.go
+++ b/.example/os/gview/build_in_funcs/build_in_funcs1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/build_in_funcs/build_in_funcs2.go b/.example/os/gview/build_in_funcs/build_in_funcs2.go
index ec1a213bc..9fc8c34ee 100644
--- a/.example/os/gview/build_in_funcs/build_in_funcs2.go
+++ b/.example/os/gview/build_in_funcs/build_in_funcs2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/build_in_funcs/issue359-1.go b/.example/os/gview/build_in_funcs/issue359-1.go
index e43fd267b..842910e4d 100644
--- a/.example/os/gview/build_in_funcs/issue359-1.go
+++ b/.example/os/gview/build_in_funcs/issue359-1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/build_in_funcs/issue359-2.go b/.example/os/gview/build_in_funcs/issue359-2.go
index 14d6a6940..f05041bee 100644
--- a/.example/os/gview/build_in_funcs/issue359-2.go
+++ b/.example/os/gview/build_in_funcs/issue359-2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/define/main.go b/.example/os/gview/define/main.go
index 233da7347..95a9c87b7 100644
--- a/.example/os/gview/define/main.go
+++ b/.example/os/gview/define/main.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gfile"
)
func main() {
diff --git a/.example/os/gview/delimiters/gview_delimiters.go b/.example/os/gview/delimiters/gview_delimiters.go
index deec2c873..139c198d6 100644
--- a/.example/os/gview/delimiters/gview_delimiters.go
+++ b/.example/os/gview/delimiters/gview_delimiters.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/func_html/func_html.go b/.example/os/gview/func_html/func_html.go
index 0e41ec1e8..0f75aa607 100644
--- a/.example/os/gview/func_html/func_html.go
+++ b/.example/os/gview/func_html/func_html.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gview"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gview"
)
func main() {
diff --git a/.example/os/gview/func_text/func_text.go b/.example/os/gview/func_text/func_text.go
index fae721814..390df9cbc 100644
--- a/.example/os/gview/func_text/func_text.go
+++ b/.example/os/gview/func_text/func_text.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/os/gview"
- "github.com/gogf/gf/util/gutil"
+ "github.com/gogf/gf/v2/os/gview"
+ "github.com/gogf/gf/v2/util/gutil"
)
func main() {
diff --git a/.example/os/gview/hot_update/controller_hot_update.go b/.example/os/gview/hot_update/controller_hot_update.go
index 9475efe0e..e3734482c 100644
--- a/.example/os/gview/hot_update/controller_hot_update.go
+++ b/.example/os/gview/hot_update/controller_hot_update.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/frame/gmvc"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/frame/gmvc"
)
func init() {
diff --git a/.example/os/gview/hot_update/gview_hot_update.go b/.example/os/gview/hot_update/gview_hot_update.go
index 1982d2805..70b7f1415 100644
--- a/.example/os/gview/hot_update/gview_hot_update.go
+++ b/.example/os/gview/hot_update/gview_hot_update.go
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gtime"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gtime"
)
func main() {
diff --git a/.example/os/gview/hot_update/web_hot_update.go b/.example/os/gview/hot_update/web_hot_update.go
index caa57ca1e..31aab9192 100644
--- a/.example/os/gview/hot_update/web_hot_update.go
+++ b/.example/os/gview/hot_update/web_hot_update.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/os/gview/i18n/i18n.go b/.example/os/gview/i18n/i18n.go
index b5a575244..c6fa628db 100644
--- a/.example/os/gview/i18n/i18n.go
+++ b/.example/os/gview/i18n/i18n.go
@@ -2,7 +2,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
func main() {
diff --git a/.example/os/gview/include/main.go b/.example/os/gview/include/main.go
index 425d23326..0fdd1d642 100644
--- a/.example/os/gview/include/main.go
+++ b/.example/os/gview/include/main.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gfile"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gfile"
)
func main() {
diff --git a/.example/os/gview/layout/layout1/main.go b/.example/os/gview/layout/layout1/main.go
index ed12906bc..644e59568 100644
--- a/.example/os/gview/layout/layout1/main.go
+++ b/.example/os/gview/layout/layout1/main.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/os/gview/layout/layout2/main.go b/.example/os/gview/layout/layout2/main.go
index f90ae6fc1..5f7d8779f 100644
--- a/.example/os/gview/layout/layout2/main.go
+++ b/.example/os/gview/layout/layout2/main.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
)
func main() {
diff --git a/.example/os/gview/object/object.go b/.example/os/gview/object/object.go
index b71f6f8f8..594a41ab2 100644
--- a/.example/os/gview/object/object.go
+++ b/.example/os/gview/object/object.go
@@ -1,7 +1,7 @@
package main
import (
- "github.com/gogf/gf/frame/g"
+ "github.com/gogf/gf/v2/frame/g"
)
type T struct {
diff --git a/.example/os/gview/resource/main1.go b/.example/os/gview/resource/main1.go
index e0cab5a15..88b96590e 100644
--- a/.example/os/gview/resource/main1.go
+++ b/.example/os/gview/resource/main1.go
@@ -3,9 +3,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gres"
- _ "github.com/gogf/gf/os/gres/testdata"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gres"
+ _ "github.com/gogf/gf/v2/os/gres/testdata"
)
func main() {
diff --git a/.example/os/gview/resource/main2.go b/.example/os/gview/resource/main2.go
index 2e18dc4d0..9892c4fc8 100644
--- a/.example/os/gview/resource/main2.go
+++ b/.example/os/gview/resource/main2.go
@@ -3,9 +3,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gres"
- _ "github.com/gogf/gf/os/gres/testdata"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gres"
+ _ "github.com/gogf/gf/v2/os/gres/testdata"
)
func main() {
diff --git a/.example/os/gview/resource/main3.go b/.example/os/gview/resource/main3.go
index ad3dbfa1d..db3e029ed 100644
--- a/.example/os/gview/resource/main3.go
+++ b/.example/os/gview/resource/main3.go
@@ -3,9 +3,9 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/os/gres"
- _ "github.com/gogf/gf/os/gres/testdata"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gres"
+ _ "github.com/gogf/gf/v2/os/gres/testdata"
)
func main() {
diff --git a/.example/text/gregex/gregex.go b/.example/text/gregex/gregex.go
index 496588af1..5c807daa8 100644
--- a/.example/text/gregex/gregex.go
+++ b/.example/text/gregex/gregex.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/text/gregex"
+ "github.com/gogf/gf/v2/text/gregex"
)
func main() {
diff --git a/.example/text/gstr/gstr_hidestr.go b/.example/text/gstr/gstr_hidestr.go
index ca3808afb..1b7e9b268 100644
--- a/.example/text/gstr/gstr_hidestr.go
+++ b/.example/text/gstr/gstr_hidestr.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/text/gstr"
+ "github.com/gogf/gf/v2/text/gstr"
)
func main() {
diff --git a/.example/text/gstr/gstr_substr.go b/.example/text/gstr/gstr_substr.go
index c78d46700..75898a51e 100644
--- a/.example/text/gstr/gstr_substr.go
+++ b/.example/text/gstr/gstr_substr.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/text/gstr"
+ "github.com/gogf/gf/v2/text/gstr"
)
func main() {
diff --git a/.example/util/gconv/gconv.go b/.example/util/gconv/gconv.go
index 20811c713..1f148d906 100644
--- a/.example/util/gconv/gconv.go
+++ b/.example/util/gconv/gconv.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_map1.go b/.example/util/gconv/gconv_map1.go
index 17a1b2d3f..e1ca4658a 100644
--- a/.example/util/gconv/gconv_map1.go
+++ b/.example/util/gconv/gconv_map1.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_map2.go b/.example/util/gconv/gconv_map2.go
index 55b8c7048..52a3c4564 100644
--- a/.example/util/gconv/gconv_map2.go
+++ b/.example/util/gconv/gconv_map2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_map_deep.go b/.example/util/gconv/gconv_map_deep.go
index 9ce95323c..80a2a82ce 100644
--- a/.example/util/gconv/gconv_map_deep.go
+++ b/.example/util/gconv/gconv_map_deep.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_map_tag.go b/.example/util/gconv/gconv_map_tag.go
index c11de8cec..727f4bf83 100644
--- a/.example/util/gconv/gconv_map_tag.go
+++ b/.example/util/gconv/gconv_map_tag.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_slice.go b/.example/util/gconv/gconv_slice.go
index b6409ec52..c306e2cac 100644
--- a/.example/util/gconv/gconv_slice.go
+++ b/.example/util/gconv/gconv_slice.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
// struct转slice
diff --git a/.example/util/gconv/gconv_struct1.go b/.example/util/gconv/gconv_struct1.go
index 35d888230..1cd680b5d 100644
--- a/.example/util/gconv/gconv_struct1.go
+++ b/.example/util/gconv/gconv_struct1.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
type User struct {
diff --git a/.example/util/gconv/gconv_struct2.go b/.example/util/gconv/gconv_struct2.go
index ed6d182a7..5d09c723b 100644
--- a/.example/util/gconv/gconv_struct2.go
+++ b/.example/util/gconv/gconv_struct2.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
// 使用默认映射规则绑定属性值到对象
diff --git a/.example/util/gconv/gconv_struct4.go b/.example/util/gconv/gconv_struct4.go
index 73e46c222..c9dba3445 100644
--- a/.example/util/gconv/gconv_struct4.go
+++ b/.example/util/gconv/gconv_struct4.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_struct5.go b/.example/util/gconv/gconv_struct5.go
index 6882e7cba..2351653a7 100644
--- a/.example/util/gconv/gconv_struct5.go
+++ b/.example/util/gconv/gconv_struct5.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_struct6.go b/.example/util/gconv/gconv_struct6.go
index 14c29b42e..a7681a0e1 100644
--- a/.example/util/gconv/gconv_struct6.go
+++ b/.example/util/gconv/gconv_struct6.go
@@ -3,8 +3,8 @@ package main
import (
"fmt"
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_struct_create.go b/.example/util/gconv/gconv_struct_create.go
index 7c6352c2e..211cfea46 100644
--- a/.example/util/gconv/gconv_struct_create.go
+++ b/.example/util/gconv/gconv_struct_create.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/gconv_struct_deep.go b/.example/util/gconv/gconv_struct_deep.go
index 15b47c60f..565766321 100644
--- a/.example/util/gconv/gconv_struct_deep.go
+++ b/.example/util/gconv/gconv_struct_deep.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/strings.go b/.example/util/gconv/strings.go
index bd8b95933..258d6d638 100644
--- a/.example/util/gconv/strings.go
+++ b/.example/util/gconv/strings.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/time1.go b/.example/util/gconv/time1.go
index b9aab0c82..825d49f5f 100644
--- a/.example/util/gconv/time1.go
+++ b/.example/util/gconv/time1.go
@@ -4,7 +4,7 @@ import (
"fmt"
"time"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gconv/time2.go b/.example/util/gconv/time2.go
index f3e054b57..c7d77a406 100644
--- a/.example/util/gconv/time2.go
+++ b/.example/util/gconv/time2.go
@@ -3,7 +3,7 @@ package main
import (
"fmt"
- "github.com/gogf/gf/util/gconv"
+ "github.com/gogf/gf/v2/util/gconv"
)
func main() {
diff --git a/.example/util/gpage/gpage.go b/.example/util/gpage/gpage.go
index 00f80ee7a..cc39411aa 100644
--- a/.example/util/gpage/gpage.go
+++ b/.example/util/gpage/gpage.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gview"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gview"
)
func main() {
diff --git a/.example/util/gpage/gpage_ajax.go b/.example/util/gpage/gpage_ajax.go
index a33a83cdc..5451472a1 100644
--- a/.example/util/gpage/gpage_ajax.go
+++ b/.example/util/gpage/gpage_ajax.go
@@ -1,9 +1,9 @@
package main
import (
- "github.com/gogf/gf/frame/g"
- "github.com/gogf/gf/net/ghttp"
- "github.com/gogf/gf/os/gview"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/os/gview"
)
func main() {
@@ -11,7 +11,7 @@ func main() {
s.BindHandler("/page/ajax", func(r *ghttp.Request) {
page := r.GetPage(100, 10)
page.AjaxActionName = "DoAjax"
- buffer, _ := gview.ParseContent(`
+ buffer, _ := gview.ParseContent(r.Context(), `