mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 11:37:52 +01:00
golint fixed for models/models.go (#284)
This commit is contained in:
parent
25b5722155
commit
bf8d90c5cc
@ -149,7 +149,7 @@ func getEngine() (*xorm.Engine, error) {
|
|||||||
}
|
}
|
||||||
case "sqlite3":
|
case "sqlite3":
|
||||||
if !EnableSQLite3 {
|
if !EnableSQLite3 {
|
||||||
return nil, errors.New("This binary version does not build support for SQLite3.")
|
return nil, errors.New("this binary version does not build support for SQLite3")
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
|
if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
|
||||||
return nil, fmt.Errorf("Fail to create directories: %v", err)
|
return nil, fmt.Errorf("Fail to create directories: %v", err)
|
||||||
@ -157,7 +157,7 @@ func getEngine() (*xorm.Engine, error) {
|
|||||||
connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc"
|
connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc"
|
||||||
case "tidb":
|
case "tidb":
|
||||||
if !EnableTiDB {
|
if !EnableTiDB {
|
||||||
return nil, errors.New("This binary version does not build support for TiDB.")
|
return nil, errors.New("this binary version does not build support for TiDB")
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
|
if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
|
||||||
return nil, fmt.Errorf("Fail to create directories: %v", err)
|
return nil, fmt.Errorf("Fail to create directories: %v", err)
|
||||||
@ -218,7 +218,7 @@ func NewEngine() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err = x.StoreEngine("InnoDB").Sync2(tables...); err != nil {
|
if err = x.StoreEngine("InnoDB").Sync2(tables...); err != nil {
|
||||||
return fmt.Errorf("sync database struct error: %v\n", err)
|
return fmt.Errorf("sync database struct error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user