mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-09 21:00:58 +00:00
fix dead code, typo, and minor bugs in main.go, process.go and index.go (#6167)
Fixes several small issues found during code review: - fix(xray): return explicit nil instead of stale err in getLogPath - fix(xray): remove duplicate doc comment on GetErrorLogPath - refactor: remove unreachable return after log.Fatalf (×4) - fix(cli): add missing newline to listen IP success message - fix(cli): typo "form" → "from" in migrate help text - refactor: simplify var+assign to short declaration for server/subServer - fix(controller): return error from getTwoFactorEnable instead of swallowing it
This commit is contained in:
@@ -163,7 +163,5 @@ func (a *IndexController) csrfToken(c *gin.Context) {
|
||||
// getTwoFactorEnable retrieves the current status of two-factor authentication.
|
||||
func (a *IndexController) getTwoFactorEnable(c *gin.Context) {
|
||||
status, err := a.settingService.GetTwoFactorEnable()
|
||||
if err == nil {
|
||||
jsonObj(c, status, nil)
|
||||
}
|
||||
jsonObj(c, status, err)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func getLogPath(key string) (string, error) {
|
||||
return logPath, nil
|
||||
}
|
||||
}
|
||||
return "", err
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// GetAccessLogPath reads the Xray config and returns the access log file path.
|
||||
@@ -93,7 +93,6 @@ func GetAccessLogPath() (string, error) {
|
||||
return getLogPath("access")
|
||||
}
|
||||
|
||||
// GetErrorLogPath reads the Xray config and returns the error log file path.
|
||||
// GetErrorLogPath reads the Xray config and returns the error log file path.
|
||||
func GetErrorLogPath() (string, error) {
|
||||
return getLogPath("error")
|
||||
|
||||
Reference in New Issue
Block a user