From 63969d5fd68367d994fa2f74c2d69ccbd7351b60 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Wed, 26 Apr 2023 11:20:22 +0200 Subject: [PATCH] Remove unused codes --- web/controller/util.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/web/controller/util.go b/web/controller/util.go index 9d5ce7c9..dc5c83b0 100644 --- a/web/controller/util.go +++ b/web/controller/util.go @@ -1,24 +1,16 @@ package controller import ( - "github.com/gin-gonic/gin" "net" "net/http" "strings" "x-ui/config" "x-ui/logger" "x-ui/web/entity" + + "github.com/gin-gonic/gin" ) -func getUriId(c *gin.Context) int64 { - s := struct { - Id int64 `uri:"id"` - }{} - - _ = c.BindUri(&s) - return s.Id -} - func getRemoteIp(c *gin.Context) string { value := c.GetHeader("X-Forwarded-For") if value != "" { @@ -85,10 +77,8 @@ func getContext(h gin.H) gin.H { a := gin.H{ "cur_ver": config.GetVersion(), } - if h != nil { - for key, value := range h { - a[key] = value - } + for key, value := range h { + a[key] = value } return a }