From b229af96070f0d72cd0f2979713d6c2162dc08aa Mon Sep 17 00:00:00 2001 From: Dzyanis Kuzmenka Date: Thu, 17 Mar 2022 23:33:34 +0300 Subject: [PATCH] fixed ineffectual assignment --- .golangci.yml | 3 +-- pkg/util/log/log.go | 2 +- server/dashboard_api.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a31ee983..d19c6beb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -73,9 +73,8 @@ linters: - unused - promlinter - nestif - # - gci - errorlint - - ineffassign + # - ineffassign - lll - contextcheck - bodyclose diff --git a/pkg/util/log/log.go b/pkg/util/log/log.go index 1ddf4cdc..ccef817f 100644 --- a/pkg/util/log/log.go +++ b/pkg/util/log/log.go @@ -52,7 +52,7 @@ func SetLogFile(logWay string, logFile string, maxdays int64, disableLogColor bo // SetLogLevel set log level, default is warning // value: error, warning, info, debug, trace func SetLogLevel(logLevel string) { - level := 4 // warning + var level int switch logLevel { case "error": level = 3 diff --git a/server/dashboard_api.go b/server/dashboard_api.go index f4f48a25..49732b60 100644 --- a/server/dashboard_api.go +++ b/server/dashboard_api.go @@ -250,7 +250,7 @@ func (svr *Service) APIProxyByTypeAndName(w http.ResponseWriter, r *http.Request }() log.Info("Http request: [%s]", r.URL.Path) - proxyStatsResp := GetProxyStatsResp{} + var proxyStatsResp GetProxyStatsResp proxyStatsResp, res.Code, res.Msg = svr.getProxyStatsByTypeAndName(proxyType, name) if res.Code != 200 { return