Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2025-09-19 11:47:28 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-19 11:47:28 +0300
commit5b00a52c652f2e037016c65c3228780e29b5bdfe (patch)
tree40a81faec1d437306f5412ecd3b17a435436e745 /web/controller/inbound.go
parent151f1173a1b592d4df51258f7635de657512cbfc (diff)
fix: ineffectual assignment to needRestart
Diffstat (limited to 'web/controller/inbound.go')
-rw-r--r--web/controller/inbound.go21
1 files changed, 6 insertions, 15 deletions
diff --git a/web/controller/inbound.go b/web/controller/inbound.go
index 19af2e1d..0a988506 100644
--- a/web/controller/inbound.go
+++ b/web/controller/inbound.go
@@ -108,8 +108,7 @@ func (a *InboundController) addInbound(c *gin.Context) {
inbound.Tag = fmt.Sprintf("inbound-%v:%v", inbound.Listen, inbound.Port)
}
- needRestart := false
- inbound, needRestart, err = a.inboundService.AddInbound(inbound)
+ inbound, needRestart, err := a.inboundService.AddInbound(inbound)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return
@@ -126,8 +125,7 @@ func (a *InboundController) delInbound(c *gin.Context) {
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.inboundDeleteSuccess"), err)
return
}
- needRestart := true
- needRestart, err = a.inboundService.DelInbound(id)
+ needRestart, err := a.inboundService.DelInbound(id)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return
@@ -152,8 +150,7 @@ func (a *InboundController) updateInbound(c *gin.Context) {
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), err)
return
}
- needRestart := true
- inbound, needRestart, err = a.inboundService.UpdateInbound(inbound)
+ inbound, needRestart, err := a.inboundService.UpdateInbound(inbound)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return
@@ -195,9 +192,7 @@ func (a *InboundController) addInboundClient(c *gin.Context) {
return
}
- needRestart := true
-
- needRestart, err = a.inboundService.AddInboundClient(data)
+ needRestart, err := a.inboundService.AddInboundClient(data)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return
@@ -216,9 +211,7 @@ func (a *InboundController) delInboundClient(c *gin.Context) {
}
clientId := c.Param("clientId")
- needRestart := true
-
- needRestart, err = a.inboundService.DelInboundClient(id, clientId)
+ needRestart, err := a.inboundService.DelInboundClient(id, clientId)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return
@@ -239,9 +232,7 @@ func (a *InboundController) updateInboundClient(c *gin.Context) {
return
}
- needRestart := true
-
- needRestart, err = a.inboundService.UpdateInboundClient(inbound, clientId)
+ needRestart, err := a.inboundService.UpdateInboundClient(inbound, clientId)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return