Skip to content

Commit

Permalink
chore: improve func name
Browse files Browse the repository at this point in the history
  • Loading branch information
qloog committed Dec 16, 2023
1 parent 5889d9c commit 39b6ebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/model/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Init() *gorm.DB {
panic(fmt.Sprintf("load orm conf err: %v", err))
}

DB = orm.NewMySQL(cfg)
DB = orm.New(cfg)
return DB
}

Expand All @@ -28,7 +28,7 @@ func GetDB() *gorm.DB {
return DB
}

// loadConf load gorm config
// loadConf load database config
func loadConf() (ret *orm.Config, err error) {
var cfg orm.Config
if err := config.Load("database", &cfg); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/orm/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type Config struct {
SlowThreshold time.Duration // 慢查询时长,默认500ms
}

// NewMySQL connect to database and create a db instance
func NewMySQL(c *Config) (db *gorm.DB) {
// New connect to database and create a db instance
func New(c *Config) (db *gorm.DB) {
var (
err error
sqlDB *sql.DB
Expand Down

0 comments on commit 39b6ebd

Please sign in to comment.