2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 07:57:21 +08:00

fix: lint

This commit is contained in:
2025-04-05 20:10:53 +08:00
parent edb5e858e4
commit e6b3858937
15 changed files with 130 additions and 45 deletions

View File

@@ -637,7 +637,9 @@ func (s *App) diskWriteTest(fileName string, blockSize int64, fileSize int64) (f
if err != nil {
return 0, 0
}
defer file.Close()
defer func(file *os.File) {
_ = file.Close()
}(file)
start := time.Now()
@@ -670,7 +672,9 @@ func (s *App) diskReadTest(fileName string, blockSize int64, fileSize int64) (fl
if err != nil {
return 0, 0
}
defer file.Close()
defer func(file *os.File) {
_ = file.Close()
}(file)
start := time.Now()

View File

@@ -42,7 +42,9 @@ func (s *App) Load(w http.ResponseWriter, r *http.Request) {
service.Success(w, []types.NV{})
return
}
defer conn.Close()
defer func(conn net.Conn) {
_ = conn.Close()
}(conn)
_, err = conn.Write([]byte("stats\nquit\n"))
if err != nil {

View File

@@ -210,7 +210,9 @@ func (s *App) SetRootPassword(w http.ResponseWriter, r *http.Request) {
return
}
} else {
defer mysql.Close()
defer func(mysql *db.MySQL) {
_ = mysql.Close()
}(mysql)
if err = mysql.UserPassword("root", req.Password, "localhost"); err != nil {
service.Error(w, http.StatusInternalServerError, "%v", err)
return