Skip to content

Commit

Permalink
Merge branch 'gogf:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
danvinhe authored Nov 3, 2021
2 parents b826ed6 + 5e7b0c9 commit 6b5369a
Show file tree
Hide file tree
Showing 1,149 changed files with 14,525 additions and 11,539 deletions.
2 changes: 1 addition & 1 deletion .example/container/garray/basic_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/v2/container/garray"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/garray/json_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/garray/json_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/garray/sorted_array_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/v2/container/garray"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/garray/sorted_string_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/garray"
"github.com/gogf/gf/v2/container/garray"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/glist/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"github.com/gogf/gf/container/glist"
"github.com/gogf/gf/v2/container/glist"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/glist/json_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/glist/json_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gmap/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/gmap"
"github.com/gogf/gf/v2/container/gmap"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gmap/gmap_json_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gmap/gmap_json_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gmap/gmap_map_clone_safe.go
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions .example/container/gmap/gmap_maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gmap/gmap_treemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gpool/gpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/gogf/gf/container/gpool"
"github.com/gogf/gf/v2/container/gpool"
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions .example/container/gpool/gpool_expirefunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ 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() {
// 创建对象复用池,对象过期时间为3000毫秒,并给定创建及销毁方法
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()
Expand Down
6 changes: 3 additions & 3 deletions .example/container/gqueue/gqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gqueue/gqueue2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions .example/container/gqueue/gqueue3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gring/gring.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/gring"
"github.com/gogf/gf/v2/container/gring"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gring/gring_josephus.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/gring"
"github.com/gogf/gf/v2/container/gring"
)

type Player struct {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gset/gset1.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/gset"
"github.com/gogf/gf/v2/container/gset"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gset/gset2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gset/json_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gset/json_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gtree/gtree_avltree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gtree/gtree_btree.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/gtree"
"github.com/gogf/gf/v2/container/gtree"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions .example/container/gtree/gtree_redblackmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gtree/gtree_redblacktree.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/gogf/gf/container/gtree"
"github.com/gogf/gf/v2/container/gtree"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gtype/gtype_int.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/container/gtype"
"github.com/gogf/gf/v2/container/gtype"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gtype/json_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gtype/json_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gvar/json_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gvar/json_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion .example/container/gvar/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/v2/frame/g"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions .example/database/gdb/driver/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions .example/database/gdb/mssql/gdb_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Loading

0 comments on commit 6b5369a

Please sign in to comment.