Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 25, 2023
1 parent b00ae6f commit 21ccf17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/http/controllers/info_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,21 @@ func (c *InfoController) CountInfo(ctx http.Context) http.Response {
}

db, err := sql.Open("mysql", "root:"+rootPassword+"@unix(/tmp/mysql.sock)/")
defer db.Close()
if err != nil {
facades.Log().With(map[string]any{
"error": err.Error(),
}).Error("[面板][InfoController] 获取数据库列表失败")
databaseCount = -1
} else {
defer db.Close()
rows, err := db.Query("SHOW DATABASES")
defer rows.Close()
if err != nil {
facades.Log().With(map[string]any{
"error": err.Error(),
}).Error("[面板][InfoController] 获取数据库列表失败")
databaseCount = -1
} else {
defer rows.Close()
var databases []database
for rows.Next() {
var d database
Expand Down

0 comments on commit 21ccf17

Please sign in to comment.