add ci for golang v1.14

This commit is contained in:
John
2020-02-26 11:54:46 +08:00
parent 7acf16fdba
commit 6317d9de53
3 changed files with 29 additions and 9 deletions

View File

@ -0,0 +1,18 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"time"
)
func main() {
db := g.DB()
db.SetDebug(true)
for {
r, err := db.Table("user").All()
fmt.Println(err)
fmt.Println(r)
time.Sleep(time.Second * 10)
}
}

View File

@ -4,6 +4,7 @@ go:
- "1.11.x"
- "1.12.x"
- "1.13.x"
- "1.14.x"
branches:
only:

View File

@ -172,7 +172,7 @@ const (
gINSERT_OPTION_SAVE = 2
gINSERT_OPTION_IGNORE = 3
gDEFAULT_BATCH_NUM = 10 // Per count for batch insert/replace/save
gDEFAULT_CONN_MAX_LIFE_TIME = 30 // Max life time for per connection in pool.
gDEFAULT_CONN_MAX_LIFE_TIME = 30 // Max life time for per connection in pool in seconds.
)
var (
@ -197,12 +197,13 @@ func New(name ...string) (db DB, err error) {
if _, ok := configs.config[group]; ok {
if node, err := getConfigNodeByGroup(group, true); err == nil {
base := &dbBase{
group: group,
debug: gtype.NewBool(),
cache: gcache.New(),
schema: gtype.NewString(),
logger: glog.New(),
prefix: node.Prefix,
group: group,
debug: gtype.NewBool(),
cache: gcache.New(),
schema: gtype.NewString(),
logger: glog.New(),
prefix: node.Prefix,
// Default max connection life time if user does not configure.
maxConnLifetime: gDEFAULT_CONN_MAX_LIFE_TIME,
}
switch node.Type {
@ -246,8 +247,8 @@ func Instance(name ...string) (db DB, err error) {
return
}
// getConfigNodeByGroup calculates and returns a configuration node of given group.
// It calculates the value internally using weight algorithm for load balance.
// getConfigNodeByGroup calculates and returns a configuration node of given group. It
// calculates the value internally using weight algorithm for load balance.
//
// The parameter <master> specifies whether retrieving a master node, or else a slave node
// if master-slave configured.