diff --git a/src/modules/transfer/backend/pool.go b/src/modules/transfer/backend/pool.go index 2b0a7b0e..6c6d96ac 100644 --- a/src/modules/transfer/backend/pool.go +++ b/src/modules/transfer/backend/pool.go @@ -83,7 +83,7 @@ func (cp *ConnPools) Update(cluster []string) { cp.M[address] = createOnePool(address, address, ct, maxConns, maxIdle) } - for address, _ := range cp.M { + for address := range cp.M { if _, exists := newCluster[address]; !exists { delete(cp.M, address) } diff --git a/src/modules/transfer/backend/query.go b/src/modules/transfer/backend/query.go index 70185037..09101980 100644 --- a/src/modules/transfer/backend/query.go +++ b/src/modules/transfer/backend/query.go @@ -178,7 +178,6 @@ func fetchDataSync(start, end int64, consolFun, endpoint, counter string, step i stats.Counter.Set("query.data.err", 1) } dataChan <- data - return } func fetchData(start, end int64, consolFun, endpoint, counter string, step int) (*dataobj.TsdbQueryResponse, error) { diff --git a/src/modules/transfer/backend/ring.go b/src/modules/transfer/backend/ring.go index 99b183cb..8cfc1e76 100644 --- a/src/modules/transfer/backend/ring.go +++ b/src/modules/transfer/backend/ring.go @@ -22,7 +22,6 @@ func (this *ConsistentHashRing) Set(r *consistent.Consistent) { this.Lock() defer this.Unlock() this.ring = r - return } func (this *ConsistentHashRing) GetRing() *consistent.Consistent { diff --git a/src/modules/transfer/config/config.go b/src/modules/transfer/config/config.go index 86d28b15..85baddc7 100644 --- a/src/modules/transfer/config/config.go +++ b/src/modules/transfer/config/config.go @@ -46,7 +46,7 @@ var ( ) func NewClusterNode(addrs []string) *backend.ClusterNode { - return &backend.ClusterNode{addrs} + return &backend.ClusterNode{Addrs: addrs} } // map["node"]="host1,host2" --> map["node"]=["host1", "host2"] diff --git a/src/modules/transfer/cron/stra.go b/src/modules/transfer/cron/stra.go index b210447e..81c57573 100644 --- a/src/modules/transfer/cron/stra.go +++ b/src/modules/transfer/cron/stra.go @@ -73,7 +73,7 @@ func getStrategy() { //var metric string if len(stra.Exprs) < 1 { - logger.Warning("stra:%v exprs illegal", stra) + logger.Warningf("stra:%v exprs illegal", stra) continue } if stra.Exprs[0].Func == "nodata" { diff --git a/src/modules/transfer/http/routes/push_router.go b/src/modules/transfer/http/routes/push_router.go index 9a5ef222..f903eadc 100644 --- a/src/modules/transfer/http/routes/push_router.go +++ b/src/modules/transfer/http/routes/push_router.go @@ -52,5 +52,4 @@ func PushData(c *gin.Context) { } render.Data(c, "ok", nil) - return } diff --git a/src/toolkits/stats/init.go b/src/toolkits/stats/init.go index 9b74917d..29f674d1 100644 --- a/src/toolkits/stats/init.go +++ b/src/toolkits/stats/init.go @@ -76,5 +76,4 @@ func push(items []*dataobj.MetricValue) { } defer resp.Body.Close() - return }