Skip to content

Commit 7db9344

Browse files
authored
fix: lint eror (#82)
1 parent 20a1d96 commit 7db9344

File tree

10 files changed

+2
-10
lines changed

10 files changed

+2
-10
lines changed

core/security/validate.go

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
type EsRequest struct {
4444
Doc string `json:"doc"`
4545
Privilege string `json:"privilege"`
46-
ClusterRequest
4746
IndexRequest
4847
}
4948

model/alerting/rule_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func TestCreateRule(t *testing.T) {
8585

8686
Metrics: Metric{
8787
Metric: insight.Metric{
88-
Groups: []insight.MetricGroupItem{{"metadata.labels.cluster_id", 10}, {"metadata.labels.node_id", 10}},
88+
Groups: []insight.MetricGroupItem{{Field: "metadata.labels.cluster_id", Limit: 10}, {Field: "metadata.labels.node_id", Limit: 10}},
8989
Items: []insight.MetricItem{
9090
{Name: "a", Field: "payload.elasticsearch.node_stats.fs.total.free_in_bytes", Statistic: "min"},
9191
{Name: "b", Field: "payload.elasticsearch.node_stats.fs.total.total_in_bytes", Statistic: "max"},

modules/agent/api/elasticsearch.go

-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ func (h *APIHandler) autoEnrollESNode(w http.ResponseWriter, req *http.Request,
424424

425425
if autoEnrollRunning.Load() {
426426
panic(errors.New("auto_enroll is already running in background"))
427-
return
428427
}
429428

430429
autoEnrollRunning.Swap(true)

modules/elastic/api/host.go

-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ func (h *APIHandler) FetchHostInfo(w http.ResponseWriter, req *http.Request, ps
468468
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, "", "", 15)
469469
if err != nil {
470470
panic(err)
471-
return
472471
}
473472
networkInMetricItem := newMetricItem("network_in_rate", 1, SystemGroupKey)
474473
networkInMetricItem.AddAxi("network_rate", "group1", common.PositionLeft, "bytes", "0.[0]", "0.[0]", 5, true)

modules/elastic/api/manage.go

-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http
554554
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, id, metricType, 90)
555555
if err != nil {
556556
panic(err)
557-
return
558557
}
559558
var metrics map[string]*common.MetricItem
560559
if bucketSize <= 60 {

modules/elastic/api/v1/cluster_overview.go

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
113113
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, clusterIDs[0], MetricTypeIndexStats, 15)
114114
if err != nil {
115115
panic(err)
116-
return
117116
}
118117

119118
query := util.MapStr{}

modules/elastic/api/v1/manage.go

-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http
522522
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, id, metricType, 90)
523523
if err != nil {
524524
panic(err)
525-
return
526525
}
527526

528527
timeout := h.GetParameterOrDefault(req, "timeout", "60s")

modules/elastic/api/v1/node_overview.go

-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ func (h *APIHandler) FetchNodeInfo(w http.ResponseWriter, req *http.Request, ps
308308
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, clusterID, MetricTypeNodeStats, 15)
309309
if err != nil {
310310
panic(err)
311-
return
312311
}
313312
// 索引速率
314313
indexMetric := newMetricItem("indexing", 1, OperationGroupKey)

plugin/api/insight/metadata.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ func getMetadataByIndexPattern(clusterID, indexPattern, timeField string, filter
466466
}}
467467
if seriesType == "column" || seriesType == "pie" {
468468
seriesItem.Metric.Groups = []insight.MetricGroupItem{
469-
{aggField.Name, 10},
469+
{Field: aggField.Name, Limit: 10},
470470
}
471471
}
472472
fieldVis := insight.Visualization{

plugin/managed/server/instance.go

-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ func (h *APIHandler) createInstance(w http.ResponseWriter, req *http.Request, ps
163163
obj.Name = res.Name
164164
}
165165
obj.Application = res.Application
166-
res.Network = res.Network
167166

168167
exists, err := orm.Get(obj)
169168
if err != nil && err != elastic.ErrNotFound {

0 commit comments

Comments
 (0)