Skip to content

Commit

Permalink
change NewDB to NewGorm
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Sep 9, 2020
1 parent 4dcc560 commit 3882d2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions orm/gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Gorm() *Client {
}

// 初始化Gorm
func NewDB(dbname string) {
func NewGorm(dbname string) {
var (
orm *gorm.DB
err error
Expand All @@ -36,7 +36,7 @@ func NewDB(dbname string) {
err = retry.Retry(func() error {
orm, err = openORM(dbname)
if err != nil {
xlog.Errorf("NewDB(%s) error:%+v", dbname, err)
xlog.Errorf("NewGorm(%s) error:%+v", dbname, err)
return err
}
return nil
Expand Down
6 changes: 3 additions & 3 deletions orm/gorm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
)

func TestNewDB(t *testing.T) {
//NewDB("a")
//NewDB("b")
//NewDB("c")
//NewGorm("a")
//NewGorm("b")
//NewGorm("c")

// only example
//Gorm().GetORM().Select("id").Where("id = ?", 1).First(nil)
Expand Down

0 comments on commit 3882d2e

Please sign in to comment.